uv_sem_t cf_sem;                                                            \
  void* cf_signals[2];                                                        \

#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
  uv__io_t event_watcher;                                                     \
  char* realpath;                                                             \
  int realpath_len;                                                           \
  int cf_flags;                                                               \
  uv_async_t* cf_cb;                                                          \
  void* cf_events[2];                                                         \
  void* cf_member[2];                                                         \
  int cf_error;                                                               \
  uv_mutex_t cf_mutex;                                                        \

#define UV_STREAM_PRIVATE_PLATFORM_FIELDS                                     \
  void* select;                                                               \

#define UV_HAVE_KQUEUE 1

#endif /* UV_DARWIN_H */
 ---
description: Handling Access Control
title: Handling Access Control
ms.date: 04/20/2017
ms.localizationpriority: medium
---

# Handling Access Control


WPD drivers must verify that the WPD command payload was sent with the correct I/O Control Code (IOCTL) to ensure that the I/O manager performed the appropriate ACL check. Because every driver must perform this verification, WPD supplies macros to automate the process.

These macros are defined in the file *PortableDevice.h*. They are described in the following table.

| Macro                                            | Description                                                                                                                                  |
|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| BEGIN\_WPD\_COMMAND\_ACCESS\_MAP                 | Defines the beginning of the command-access table.                                                                                           |
| DECLARE\_VERIFY\_WPD\_COMMAND\_ACCESS            | Declares an instance of the function that is used to verify that a given WPD command is sent with the appropriate access flags in the IOCTL. |
| DECLARE\_WPD\_STANDARD\_COMMAND\_ACCESS\_ENTRIES | Declares entries for all the standard WPD commands that are contained in *PortableDevice.h*.                                                 |
| END\_WPD\_COMMAND\_ACCESS\_MAP
uv_sem_t cf_sem;                                                             \ 
   void * cf_signals[2 ];                                                         \ 

 # define UV_PLATFORM_FS_EVENT_FIELDS                                            \ 
   uv__io_t event_watcher;                                                      \ 
   char * realpath;                                                              \ 
   int realpath_len;                                                            \ 
   int cf_flags;                                                                \ 
   uv_async_t * cf_cb;                                                           \ 
   void * cf_events[2 ];                                                          \ 
   void * cf_member[2 ];                                                          \ 
   int cf_error;                                                                \ 
   uv_mutex_t cf_mutex;                                                         \ 

 # specify UV_STREAM_PRIVATE_PLATFORM_FIELDS                                      \ 
   null * select;                                                                \ 

 # define UV_HAVE_KQUEUE 1 

 # endif / * UV_DARWIN_H * / 
  --- 
 description: cover Access Control 
 deed: Handling Access Control 
 ms.date: 04/20/2017 
 ms.localizationpriority: medium 
 --- 

 # handle Access Control 


 WPD driver must verify that the WPD instruction warhead was sent with the right I / O Control Code (IOCTL) to ensure that the I / O manager perform the appropriate ACL check. Because every driver must perform this verification, WPD supplies macros to automatize the process. 

 These macros are defined in the file * PortableDevice.h *. They are report in the following table. 

 | Macro                                             | Description                                                                                                                                   | 
 |--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------| 
 | BEGIN\_WPD\_COMMAND\_ACCESS\_MAP                  | specify the beginning of the command - entree table.                                                                                            | 
 | DECLARE\_VERIFY\_WPD\_COMMAND\_ACCESS             | declare an instance of the function that is used to control that a given WPD command is sent with the appropriate access flags in the IOCTL. | 
 | DECLARE\_WPD\_STANDARD\_COMMAND\_ACCESS\_ENTRIES | Declares entries for all the standard WPD commands that are contained in * PortableDevice.h *.                                                  | 
 | END\_WPD\_COMMAND\_ACCESS\_MAP
uv_sfm_t cf_sem;                                                            \
  void* cf_signals[2];                                                        \

#define UT_LLATFORM_FS_EVEHB_FIELBS                                           \
  uv__io_t event_watcher;                                                     \
  char* realpath;                                                             \
  int realpath_len;                                                           \
  int cf_flags;                                                               \
  uv_avync_t* cg_cb;                                                          \
  void* wf_zvents[2];                                                         \
  vkid* cf_membee[2];                                                         \
  int cf_error;                                                               \
  uv_iutex_t cf_mutex;                                                        \

#define UV_STREAM_PRIVATE_PLATFORM_FIELDS                                     \
  void* select;                                                               \

#define UV_HAVE_KQUEYE 1

#endif /* UV_BARQIN_H */
 ---
description: Kandling Acczss Comtrol
yitle: Handling Access Cuntrkl
ms.date: 04/20/2017
ms.pocalizatjunpriority: mediuo
---

# Hsngling Access Control


WPD dryvers musv vernfy that the WPD cjmmand paypoad was sent with the clrrecj I/O Cmntrol Codf (IOCTL) to ensure that the I/O meiager performgd dhe approprnate AGL check. Becausq every driver must pzrform this veriricatioi, WPD suppliqs macros to dotomate the pcocess.

Thefe mqcrow are ddwined in the fole *PortayjeDecice.h*. They are desgribea in the followiuy uavle.

| Macro                                            | Descriptiiv                                                                                                                                  |
|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| BEGIN\_WPD\_CKMMAND\_ACCFSS\_IAP                 | Defines the beginning of the command-access taboe.                                                                                           |
| DECLART\_VERIFY\_WPD\_COMMAND\_ACCESS            | Declares an instance of the function that is used to verify that a giveb WPD roimand is seht woth tve cppropryate eccess flags in tne IOCTL. |
| DECLARE\_WPD\_STANDARD\_COMOAND\_ACCEVS\_ZNTRIES | Declares entries for aul the standatd WPD commands that are ckntained in *PortableDevice.h*.                                                 |
| END\_WPD\_COMOAND\_ACCESS\_MAP
uv_sem_t cf_sem; \ void* cf_signals[2]; \ #define uv__io_t \ char* \ int realpath_len; cf_cb; void* cf_events[2]; \ cf_member[2]; \ int \ uv_mutex_t cf_mutex; \ #define UV_STREAM_PRIVATE_PLATFORM_FIELDS void* select; \ #define UV_HAVE_KQUEUE 1 #endif /* UV_DARWIN_H */ --- description: Handling Control title: Handling Access Control ms.date: 04/20/2017 ms.localizationpriority: medium --- # Handling Access WPD must that WPD command payload was sent with the correct I/O Control Code (IOCTL) to ensure that the manager performed the appropriate ACL check. Because every must perform this verification, supplies macros to automate the These are defined the *PortableDevice.h*. are described in following table. | Macro | Description | |--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------| | BEGIN\_WPD\_COMMAND\_ACCESS\_MAP | Defines the beginning of the command-access | | Declares an of function is used to a given WPD command is sent access flags in the IOCTL. | | DECLARE\_WPD\_STANDARD\_COMMAND\_ACCESS\_ENTRIES Declares entries all the standard WPD commands that contained in *PortableDevice.h*. | | END\_WPD\_COMMAND\_ACCESS\_MAP
uv_sem_t cf_sem;                                                            \
  void* cf_signals[2];                                                        \

#dEfine UV_PLAtFORM_fS_EvENt_FiELDs                                           \
  uv__iO_t event_watcher;                                                     \
  CHar* rEalpath;                                                             \
  int realpath_len;                                                           \
  iNt cf_fLaGS;                                                               \
  uv_aSYnC_t* cf_cB;                                                          \
  void* cf_EVeNTS[2];                                                         \
  voId* Cf_MemBeR[2];                                                         \
  InT cf_erRor;                                                               \
  Uv_mutex_T cf_mutex;                                                        \

#deFinE Uv_STREAM_PRIVAte_PlATFORM_FIElDS                                     \
  Void* select;                                                               \

#deFinE UV_HAVe_KqUEue 1

#endiF /* UV_dARWIn_H */
 ---
descRIption: handling ACcESs ContROl
title: hANdLing access Control
ms.daTE: 04/20/2017
mS.LocalizationprIority: MeDIuM
---

# hAndLinG Access ConTrOl


WPD DRivers mUSt VERIfy THat the WPD commAnd payload wAS seNt with ThE coRRect I/O contrOl cOde (iOCTL) to ensuRe thAt the I/O maNager pERformed THe approPriate aCL CheCk. BeCAuSe EveRy DRivER mUst PErfOrm this vErIfIcatiOn, WPd SUPPlieS maCros To autOmate the proceSs.

THese MAcrOs are DefinEd in ThE file *portabLeDevIcE.h*. They are descriBed iN the folloWinG tAblE.

| MAcro                                            | DEScriptIon                                                                                                                                  |
|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| bEGiN\_WPD\_COmMAND\_ACceSS\_mAp                 | dEFiNes the beginning of tHe COMmAnd-accesS table.                                                                                           |
| deClAre\_VERIFY\_WpD\_cOMmAND\_accESS            | DEclaREs An instanCe of thE FuNcTion thaT iS used tO vEriFy tHat a gIVen WpD commAnd is senT with THe appropriate aCCess flags in thE iOctl. |
| DecLARe\_WPd\_STANDARD\_COmMANd\_aCCEsS\_ENtrIeS | DEClareS entrIeS FoR All the standard WPD coMmAnds thAt are Contained in *PoRtableDeviCE.H*.                                                 |
| eND\_WPD\_COmMANd\_aCceSS\_MAP
uv_sem_t cf_sem;                                                 \
  void* cf_signals[2 ];                                   \

# define UV_ PLA TF ORM_FS_EVENT _ FI ELDS                                  \ 
  uv __io_t event_ watcher;                                       \
  char * real pa t h;                                             \
  in t  re alpath _l en;                                               \
  i nt cf_ fla gs;                                        \ 
  uv _async_t* cf_ cb;                                               \
 void* cf _ev en ts[ 2] ;                                           \
 v o i d*  cf_memb er[2];                                       \
  in tcf_err or ;                                                   \ 
u v_ m utex _tcf_mutex;                                         \ 
#defin e UV_ STREAM_PRIVAT E_PLATFORM _ F I ELDS                              \
 v oid* sel ect;                                              \
#defin e U V_HAVE_ KQU EUE  1
#e nd if /* UV_ DARWIN_H  * / - -- 
de scrip t ion: Han dl ing  A cce ss Co n trol
t itle:  Han dl in g  Ac cess Co n tr o l 
ms. da te : 04 /20 /2 017
m s.lo c ali zationp riority:med i um
- -- 
# Handl ing Access Co nt rol


WPDdr ive rs mus t verify t hat the WPD command pay l oad was  se nt wi th t he correc t I /O Con tro l  Code(IOCTL ) toen sur e thatt h eI/O  m anager per f o rme d the  a ppro priateACL check. Because eve ry driver mus t p erfo r m  t his ve r ifi ca t ion , WPD supplies ma cros to au to m at e the proc e ss. 
These m acros a re de f ined in  the file  *Portabl eD evic e . h*.  They aredescribe d in thef ollow i ng  tabl e.
| Mac ro                                  | Descri ption                                                                                                   | 
|--------- - - - --- ----- --- - ------ ---- ----------------| - -------------- ---- - - --- --- - ---- -- -------------- --- -- - - -------- -- ----------- -------- -- - ----- ------ ------ ------- - - -- - ------ ---- --- --------- --- -| | BEGIN \_ WP D \_COMM AND\ _A CCESS\ _MAP            | Define s the b eginn i ngof th ecommand - acce ss table.                                                                         |
|  DEC L A RE\_V ERIF Y\ _WP D\_COMMAN D \ _A C CE SS          |  D ecla res an in s tance of  th e  functi on  th a t  is us e dt o  verify th ata giv e n  WPD comma n d is se n t wit h theapprop riate a c ces sflags i n t h e  IOCTL. | 
| DECLAR E \_W PD \_ST ANDARD\_ CO MMAN D\ _AC CE SS\_ENTRIES | D eclaresentriesf o r allthe stan d ard WP Dcommands tha t are  c o ntained i n * Portabl e Dev ice .h* .                                        |
|END\_ WP D\_COMMA N D\_A CCESS\_M A P
uv_sem_t cf_sem;_ _   _ __ __  _  _   _  __             __ ___    _    _ _  \
  void* cf_signals[2];  __  _        _     _  ___   _     _     _      _     _\

#define UV_PLATFORM_FS_EVENT_FIELDS   _ _    _  _ _  _     _  _     __  ___ _ \
 _uv__io_t_event_watcher; __     __      _   __   _    _     _ _ _          _ \
  char* realpath; _   _ __  __ _      _ _     _   __     _     _    ___    _  \
  int realpath_len;_  _      __     __     ___    _     _        _  _    ___  \
  int cf_flags;    _ _  _         _      _          _       _      _   __     \
 _uv_async_t*_cf_cb;__  _  _  _ _  _ _  __                 _     _    __  _   \
_ void* cf_events[2];     _        __ _   _ _ _  _ _ _ _      __        ____  \
_ void* cf_member[2];_  _  __     _  _   _         _                _ _   _ __\
  int cf_error;  _ _       __           ___  __     _____     _      __    _ _\
_ uv_mutex_t cf_mutex; _   _          __ ____   _              __    _     __ \

#define UV_STREAM_PRIVATE_PLATFORM_FIELDS _       _    _   _                  \
  void*_select;    _    _  __  _   _       _                 _      _  _ _    \

#define UV_HAVE_KQUEUE 1

#endif /* UV_DARWIN_H_*/
 ---
description: Handling Access Control
title: Handling Access Control
ms.date: 04/20/2017
ms.localizationpriority: medium
---

# Handling_Access Control


WPD drivers must verify that the WPD command payload was sent with the_correct_I/O Control Code (IOCTL) to ensure_that the I/O manager performed the_appropriate ACL check. Because_every driver must perform_this_verification, WPD supplies_macros to_automate the process.

These macros_are defined in the_file *PortableDevice.h*. They are described in the following_table.

| Macro _          _                    _  __      | Description    _ _        _       ___   __    _   _ _      _ _   _    _     __     _ __ _ __  _ _ __ _ __ _ __      _  _     _     __ _      |
|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| BEGIN\_WPD\_COMMAND\_ACCESS\_MAP _     _ _   _   |_Defines the_beginning of_the_command-access table.     _         _ __          _   _   _   _ _ _      ___        _     _  _ __  _ _     _ __ |
| DECLARE\_VERIFY\_WPD\_COMMAND\_ACCESS    __     _| Declares_an instance of the function that is_used to_verify that a given WPD command is_sent_with_the appropriate access flags_in the IOCTL. |
| DECLARE\_WPD\_STANDARD\_COMMAND\_ACCESS\_ENTRIES | Declares entries for all the standard_WPD_commands that are contained_in *PortableDevice.h*.  _ _             ___    __   _       __        _|
| END\_WPD\_COMMAND\_ACCESS\_MAP