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.

106 lines
4.1 KiB

  1. Principles of Operation as Written:
  2. The command line is parsed looking for 1) switch delimiter followed by switch character.
  3. Following a switch character, the parser ignores the rest of the switch string, looking for
  4. either another switch or a string not preceded by a switch character.
  5. Any string found between either another switch character or the end of the line, is taken
  6. to be a string argument associated with the switch. This permits these arguments to
  7. embed whitespace.
  8. Some switches are defined as of primary nature, as they indicate the basic operation
  9. being performed. Thus the A switch indiates that an ADD operation is in progress.
  10. Generally, non-primary switches may occur with more than one primary switch. There
  11. are specific help strings provided for each primary switch.
  12. Once the switches are identified and paired with their string arguments where applicable,
  13. validation checks (mutually exclusive, necessary data, etc) checks are performed, and
  14. then the primary task handlers are invoked.
  15. switches.h defines compile-time switches meaningful to the project as a whole
  16. cmdkey.cpp is the main file, which contains the implementation of the functionality
  17. command.cpp contains the command line parsing code
  18. io.cpp contains command window in/output routines and string resource fetch functions
  19. utils.cpp contains a collection of utility functions
  20. consmsg.mc contains resource strings.
  21. Note that io.h defines a global static allocation which is used for console output, as well
  22. as a common array used for parameters to FormatMessage() for parameter substitution
  23. in the ComposeString(), and for the PrintString() function.
  24. 07/25 17:04
  25. Cred creation using redirection from a file into a prompt, specifically
  26. the one from credui to get a password, does not work. Creation of a
  27. generic credential in this way, using a psw.txt file, produced a generic
  28. credential without password.
  29. 07/26 15:05
  30. The string i/o routines are the same as those used by credui and by the
  31. net command. Neither of those can accept redirected input properly,
  32. either. This behavior is classified as by design for the app.
  33. 08/02 11:58
  34. Changes to the console i/o routines for cmdkey will not have any effect
  35. on the ability to accept redirection. cmdkey does no console input
  36. once launched. The only console input activity is from credui in response
  37. to calls to CredUIPromptForCredentials(). Unless credui is updated,
  38. this cannot be changed. In any event, the code issue is not within
  39. cmdkey.
  40. 08/06 17:02
  41. change to help text to remove brackets from optional strings, and also
  42. to correct generic help to use the correct switchname.
  43. 08/23 13:43
  44. Changes (described in changed form):
  45. 1. cmdkey cannot create a ras cred
  46. 2. ras cred switch changed from /s to /r
  47. 3. smartcard switch from /c to /s
  48. 4. help text updated
  49. 5. deletion fixed so that invalid parameter not seen
  50. 6. marshalled cert usernames changed to fixed string <Certificate>
  51. 7. Help enhanced so that the help you see if the one most likely for
  52. the operation you were attempting.
  53. 08/24 15:42
  54. Added missing version resource.
  55. Still need to generate and include the SLD file.
  56. 08/27 12:17
  57. Dependencies (starred ones listed in SLD, others are downstream)
  58. ADVAPI32.DLL *
  59. CREDUI.DLL *
  60. GDI32.DLL
  61. KERNEL32.DLL *
  62. MSVCRT.DLL *
  63. NTDLL.DLL
  64. RPCRT4.DLL
  65. SHELL32.DLL
  66. SHLWAPI.DLL
  67. USER32.DLL
  68. Files to add on checkin are 14:
  69. cmdkey.cpp
  70. cmdkey.rc
  71. cmdkey.sld
  72. command.h
  73. command.cpp
  74. comments.txt (this file)
  75. consmsg.mc
  76. io.h
  77. io.cpp
  78. makefile
  79. sources
  80. switches.h
  81. utils.h
  82. utils.cpp
  83. Files to edit on checkin are 3:
  84. ..\dirs
  85. mergedcomponents\setupinfs\layout.inx <- add new line patterned after that for keymgr.dll
  86. published\sdk\lib\placefil.txt <- add new line patterned after that for keymgr.dll