Source code of Windows XP (NT5)
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.

175 lines
7.7 KiB

  1. Program Interface for C2Config Dll's
  2. Written: 7-Feb-95
  3. Revisions: none
  4. Overview
  5. The C2Config utility provides an extensible interface for adding
  6. additional security functions to be displayed and controlled from
  7. the C2Config list. These functions are provided in the form
  8. of a dynamic-link library (DLL) that is referenced in the
  9. C2CONFIG.INF file. This file describes the interface requirements
  10. for these additional functions.
  11. A C2Config DLL must include the C2DLL.H file for the structure
  12. definitions used between the main application program and the DLL.
  13. The DLL must also supply the following exported entry points for use
  14. by the application (the actual function names may be defined by the
  15. DLL developer). The following function names will be used in this
  16. description when referencing the DLL functions.
  17. GetStatusFunction
  18. UserInterfaceFunction
  19. SetStatusFunction
  20. The actual function names defined in the DLL must be listed in the
  21. C2CONFIG.INF file for them to be recognized by the application.
  22. GetStatusFunction
  23. When the application is first started and whenever the Refresh
  24. display menu item is selected, the GetStatusFunction for each
  25. item is called to determine the current status of that item.
  26. The application calls the function, passing the pointer to a
  27. C2DLL_DATA data structure initialized as follows:
  28. lActionCode = 0
  29. lActionValue = 0
  30. hWnd = window handle to main app window
  31. lC2Compliance = C2DLL_NOT_SECURE;
  32. szItemName = ItemName as read from C2CONFIG.INF file
  33. szStatusName = Empty String (all null chars) on first
  34. call, previous status on all subsequent
  35. calls
  36. The GetStatusFunction then determines the current state of the
  37. item it is responsible for and fills in the following fields
  38. of the C2DLL_DATA structure whose pointer was passed in the
  39. argument list:
  40. lActionCode = (not used)
  41. lActionValue = (not used)
  42. hWnd = (not changed)
  43. lC2Compliance = Current compliance value
  44. szItemName = (not changed)
  45. szStatusName = string describing current status of this
  46. item
  47. After detecting the current status of the security item and
  48. filling in the C2DLL_DATA structure, the function returns the
  49. WIN32 error status value describing the success or failure of the
  50. function call. The data returned will be assumed valid only if
  51. the return status is ERROR_SUCCESS;
  52. UserInterfaceFunction
  53. The User Interface Function is called when the user double-clicks
  54. or otherwise selects a security item from the list displayed in
  55. the main application window. The purpose of this function is to
  56. allow the user to change the current state of the selected item.
  57. When the item is selected, the function is called, passing a
  58. pointer to the C2DLL_DATA structure as the only argument. The
  59. fields in the structure are initialized as follows:
  60. lActionCode = 0
  61. lActionValue = 0
  62. hWnd = the window handle of the main app window
  63. lC2Compliance = the current compliance value as returned by
  64. the last GetStatusFunction call
  65. szItemName = the name string for this item as read from
  66. the C2CONFIG.INF file
  67. szStatusName = the string describing the current status of
  68. this item as returned by the last call to
  69. the GetStatusFunction
  70. The Display function will present the necessary user interface to
  71. the user for their input and then fill the following fields of
  72. the C2DLL_DATA block referenced by the pointer passed in the
  73. argument list:
  74. lActionCode = code describing action to take in order to
  75. perform task selected by user.
  76. 0 == no change or no action
  77. lActionValue = value to be used, if necessary, if the
  78. lActionCode is not 0
  79. hWnd = (not changed)
  80. lC2Compliance = (not changed)
  81. szItemName = (not changed)
  82. szStatusName = (not changed)
  83. The UserInterfaceFunction returns a Win32 error status value as
  84. the return value of the function to indicate if the function was
  85. successful or not. If the return code is not ERROR_SUCCESS, then
  86. the returned data is ignored.
  87. SetStatusFunction
  88. If the lActionCode field in the data structure returned by the
  89. UserInterfaceFunction is not 0, then the SetStatusFunction is
  90. called. The C2DLL_DATA structure passed to the SetStatusFunction
  91. is unchanged from the data returned by the UserInterfaceFunction.
  92. The SetStatusFunction performs the action defined in the
  93. lActionCode field of the structure, using the lActionValue
  94. field as necessary. If the status of the item is changed, then
  95. this routine must update the following fields in the data
  96. structure.
  97. lActionCode = set to 0
  98. lActionValue = set to 0
  99. hWnd = (not changed)
  100. lC2Compliance = set to the current state (as a result of
  101. the change)
  102. szItemName = (not changed)
  103. szStatusName = set to the current state (as a result of
  104. the change)
  105. The SetStatusFunction returns a Win32 error status code to
  106. indicate the success or failure of the function, and the list
  107. entry in the main application window is updated to show the
  108. current status of this item.
  109. C2CONFIG.INF
  110. Each entry in the main application window is described in the
  111. C2CONFIG.INF file. The file consists of a single section under the
  112. [C2 Security Items] section heading. Under that section, each
  113. entry consists of the following elements:
  114. Item Name = this is the string to be displayed in the
  115. application window under the "Security
  116. Feature" heading. Make sure the text is
  117. not so long as to be truncated in the
  118. display.
  119. DLL = the filename of the DLL that contains the
  120. functions that follow in the entry.
  121. The DLL must be located in one of the
  122. following directories in order to be
  123. recognized by the application:
  124. The current directory
  125. The WINDOWS (%systemroot%) directory
  126. The SYSTEM (%systemroot%\SYSTEM32) directory
  127. The directory containing C2CONFIG.EXE
  128. a directory in the "Path"
  129. QueryFn = the exported function name found in the DLL
  130. file mentioned above that performs the
  131. GetStatusFunction service described above.
  132. SetFn = the exported function name found in the DLL
  133. file mentioned above that performs the
  134. SetStatusFunction service described above.
  135. UserInterfaceFn = the exported function name found in the
  136. DLL file mentioned above that performs the
  137. UserInterfaceFunction service described above.
  138. RebootIfChanged = "1" if changing this feature requires the
  139. system to be restarted in order for the
  140. change to take effect. Otherwise, this value
  141. should be a "0".