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.

95 lines
3.8 KiB

  1. Notes about using AcWebSvc.dll
  2. ------------------------------
  3. In order for AcWebSvc.dll to hook a process, two things must happen:
  4. - AcWebSvc.dll must be copied into the %windir%\apppatch directory.
  5. - An entry must be made in the App Compat database.
  6. To create the entry in the App Compat database, it's necessary
  7. to create an xml file describing the process to be hooked.
  8. Below is sample xml that describes a pretty contrived scenario. It
  9. basically hooks notepad.exe and associates it with an IIS application
  10. called "Notepad IIS App!". This fake application includes two ISAPI
  11. extensions called, GetClientInfo.dll and ReadEntity.dll, which are
  12. installed in a path that can be acquired by reading a key from the
  13. registry. It has a dependency on its own ISAPI extensions and also
  14. something (that is also made up) called IISASP60. Finally, the sample
  15. uses a setup indicator file, called "file.txt" to determine whether
  16. the app is installed or not (note that this entry is optional in the
  17. xml, and if a SetupIndicatorFile is not present, the shim will use
  18. the presence of any of the listed extensions to determine if the
  19. shimmed process installed or uninstalled.) Finally, the shim is
  20. able to force enable all dependencies of this application, including
  21. both its own extensions and any dependent applications. To do this,
  22. set the "HonorDisabledExtensionsAndApplications" setting to "FALSE".
  23. Note that this violates our suggested best practices for app
  24. installation, and will enable all dependencies even if the administrator
  25. for the server intentionally disabled them for security reasons.
  26. To insert the xml into the database, first create a database file
  27. by running the following command, which produces a file called
  28. notepad.sdb:
  29. shimdbc custom notepad.xml notepad.sdb
  30. Finally, to include the notepad.sdb file into the database, run
  31. the following command:
  32. sdbinst notepad.sdb
  33. Once these steps are done, any processes called "notepad.exe" will
  34. inject AcWebSvc.dll and hook on process exit.
  35. To remove the entry from the AppCompat database, run the
  36. following command:
  37. sdbinst -u notepad.exe
  38. For more information about creating xml to describe a "real"
  39. application, see the following:
  40. http://winwebsites/AppCompat/Development.
  41. For more information about how the DATA tags work with
  42. the IIS lockdown mechanism, see section 4.1.2.1 of the
  43. following:
  44. http://iis6/Specs/SecurityConsoleMetadata.doc
  45. -----Sample XML-----
  46. <?xml version="1.0" encoding="Windows-1252"?>
  47. <DATABASE NAME="IIS Database">
  48. <LIBRARY>
  49. <SHIM NAME="EnableIIS" FILE="AcWebSvc.dll"/>
  50. </LIBRARY>
  51. <APP NAME="Sample XML Using Notepad" VENDOR="Microsoft">
  52. <EXE NAME="NOTEPAD.EXE">
  53. <SHIM NAME="EnableIIS" COMMAND_LINE="%DbInfo%">
  54. <INCLUDE MODULE="*"/>
  55. <INCLUDE MODULE="%EXE%"/>
  56. <DATA NAME="AppName" VALUETYPE="STRING" VALUE="Notepad IIS App!"/>
  57. <DATA NAME="BasePath" VALUETYPE="STRING" VALUE="HKEY_LOCAL_MACHINE\Software\WadeH\InstallPath"/>
  58. <DATA NAME="PathType" VALUETYPE="STRING" VALUE="1"/>
  59. <DATA NAME="WebSvcExtensions" VALUETYPE="STRING" VALUE="GetClientInfo.dll,ReadEntity.dll"/>
  60. <DATA NAME="GroupID" VALUETYPE="STRING" VALUE="NPISA"/>
  61. <DATA NAME="GroupDesc" VALUETYPE="STRING" VALUE="Way Cool Notepad IIS Stuff!"/>
  62. <DATA NAME="EnableExtGroups" VALUETYPE="STRING" VALUE="IISASP60"/>
  63. <DATA NAME="SetupIndicatorFile" VALUETYPE="STRING" VALUE="file.txt"/>
  64. <DATA NAME="HonorDisabledExtensionsAndDependencies" VALUETYPE="STRING" VALUE="TRUE"/>
  65. </SHIM>
  66. </EXE>
  67. </APP>
  68. </DATABASE>
  69. -----Sample XML-----