Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name :
  4. drdevlst.h
  5. Abstract:
  6. Manage a list of installed devices for the user-mode RDP device manager
  7. component.
  8. Author:
  9. TadB
  10. Revision History:
  11. --*/
  12. #ifndef _DRDEVLST_
  13. #define _DRDEVLST_
  14. #include <rdpdr.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif // __cplusplus
  18. //
  19. // Device List Definitions
  20. //
  21. typedef struct tagDRDEVLSTENTRY
  22. {
  23. DWORD clientDeviceID; // Client-given device ID.
  24. DWORD serverDeviceID; // Server-given device ID.
  25. DWORD deviceType;
  26. BOOL fConfigInfoChanged;
  27. WCHAR *serverDeviceName; // Server-designated device name
  28. WCHAR *clientDeviceName; // Client-designated device name
  29. UCHAR preferredDosName[PREFERRED_DOS_NAME_SIZE];
  30. time_t installTime; // Time device was installed.
  31. PVOID deviceSpecificData; // Hook for additional device-specific
  32. // data.
  33. } DRDEVLSTENTRY, *PDRDEVLSTENTRY;
  34. typedef struct tagDRDEVLST
  35. {
  36. PDRDEVLSTENTRY devices;
  37. DWORD deviceCount;// Number of elements in device list.
  38. DWORD listSize; // Size, in bytes, of the device list.
  39. } DRDEVLST, *PDRDEVLST;
  40. // Create a new device list.
  41. void DRDEVLST_Create(
  42. IN PDRDEVLST list
  43. );
  44. // Destroy a device list. Note that the pointer to the list is not released.
  45. void DRDEVLST_Destroy(
  46. IN PDRDEVLST list
  47. );
  48. // Add a device to a device management list.
  49. BOOL DRDEVLST_Add(
  50. IN PDRDEVLST list,
  51. IN DWORD clientDeviceID,
  52. IN DWORD serverDeviceID,
  53. IN DWORD deviceType,
  54. IN PCWSTR serverDeviceName,
  55. IN PCWSTR clientDeviceName,
  56. IN PCSTR preferredDosName
  57. );
  58. // Remove the device at the specified offset.
  59. void DRDEVLST_Remove(
  60. IN PDRDEVLST list,
  61. IN DWORD offset
  62. );
  63. // Return the offset of the device with the specified id.
  64. BOOL DRDEVLST_FindByClientDeviceID(
  65. IN PDRDEVLST list,
  66. IN DWORD clientDeviceID,
  67. IN DWORD *ofs
  68. );
  69. // Return the offset of the device with the specified id and device type.
  70. BOOL DRDEVLST_FindByClientDeviceIDAndDeviceType(
  71. IN PDRDEVLST list,
  72. IN DWORD clientDeviceID,
  73. IN DWORD deviceType,
  74. IN DWORD *ofs
  75. );
  76. // Returns the offset of the device with the specified server-assigned id.
  77. BOOL DRDEVLST_FindByServerDeviceID(
  78. IN PDRDEVLST list,
  79. IN DWORD serverDeviceID,
  80. IN DWORD *ofs
  81. );
  82. // Return the offset of the device with the specified name.
  83. BOOL DRDEVLST_FindByServerDeviceName(
  84. IN PDRDEVLST list,
  85. IN PCWSTR serverDeviceName,
  86. IN DWORD *ofs
  87. );
  88. #ifdef __cplusplus
  89. }
  90. #endif // __cplusplus
  91. #endif //#ifndef _DRDEVLST_