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.

236 lines
7.6 KiB

  1. user assistance
  2. 980227
  3. andyp, lamadio, et. al.
  4. - abstract
  5. ...
  6. - contents
  7. ...
  8. overview
  9. ...
  10. events
  11. sessions, counts, and aging
  12. aging
  13. (todo)
  14. testing: hooks, utils, etc.
  15. testing: scenarios
  16. testing: specifics
  17. testing: anomalies
  18. - overview
  19. ...
  20. uassist events
  21. intelli-menu
  22. app mgmt
  23. - ...
  24. ...
  25. - events
  26. IUserAssist
  27. FireEvent(pguidGrp, eCmd, dword, wP, lP)
  28. Set/QueryEvent(..., puai)
  29. guid,cmd,dword,wP,lP
  30. events
  31. standard: UI*, RUN*, etc.
  32. user: USER+n (NYI)
  33. logging
  34. guid,cmd,wP,lP
  35. typically encoded as "cmd:wP,lP"
  36. RUNPIDL:%csidl2%/vb/readme.lnk
  37. RUNPIDL:%csidl2%/command prompt.lnk
  38. RUNWMCMD:0xff,1f8
  39. instrumentation
  40. beta-only (but must test!)
  41. just like logging, but...
  42. not aged
  43. "UserAssist2" not UserAssist
  44. regkey Instrument = DWORD 1
  45. registry
  46. set uassist=$HKCU/sw/msft/win/cv/explorer/UserAssist
  47. $uassist/{guid}/Count/...
  48. compression and encryption
  49. NYI
  50. - sessions, counts, and aging
  51. we have several records:
  52. ctlsession qtMru, sidCur
  53. ctlcount:ctor sidMru, cCnt
  54. foo sidMru, cCnt
  55. each daily login to windows defines (roughly) a session. a logged item
  56. consists of a 'decayed' count and a MRU session time. there is a magic
  57. default 'ctor' item which serves as a proxy for not-yet-created items.
  58. a UASession has a session id, and a timestamp for the last update to that id.
  59. sidCur is updated at shutdown time *if* 12 hours have passed since the last
  60. incr.
  61. the time is a UATIME, stored in 1-minute (approx) increments (we take a
  62. system time, turn it into a file time, and shift it by >> 29). we chose
  63. this to fit in a DWORD, last forever, be easy to compute, and (ideally)
  64. be in 'intuitive' units. (given that we only store it in one place this
  65. may not be necessary; originally the time was stored in many places,
  66. hence the constraints).
  67. a UACount has a count cCnt and a session id sidMru for the last update
  68. to that count.
  69. there is a special count, ctlcount:ctor, which we return on a Query for
  70. a non-existent entry. for correctness and perf, we don't want to create
  71. an entry on a Query (menu reference), only on a Set (menu leaf invoke).
  72. however we want the Query's to behave *as if* they started out w/ a count
  73. of 1 and then were aged. 'inheriting' ctlcount:ctor lets us do this.
  74. note that count:ctor is used for *all* counts: menus, app mgmt, etc. so
  75. once it ages down to 0, everyone who refs it will look like 0.
  76. BUGBUG this may cause pblms for app installs (if you install an app but
  77. haven't yet used it, it will look like its unused). there is a way to
  78. tell if a count came from a default or not, so probably that should be
  79. used in this case.
  80. similar issues exist when changing (adding/moving) menu items. should
  81. changing an item increment its count? if not, untouched things which
  82. are moved after count:ctor ages to 0
  83. the sidMru's are kept around for aging. read on...
  84. - sessions
  85. a session is defined as a logoff *plus* a minimum time interval. that is,
  86. one can logon/off many times, but only 1 session will pass each 12 hours.
  87. we also have an idle timer. going idle for 12 hours forces a session. note
  88. however that we only force one such session (so if one is idle for a 1 week
  89. vacation, it is still just 1 session).
  90. 'idle' means no keyboard or mouse changes.
  91. on nt5 our idle detection is exact. on nt4 we must simulate some things,
  92. causing as much as a 2x error. (todo: checking for IdleTime more frequently,
  93. e.g. at 0.25*SessionTime, could reduce this error considerably).
  94. - aging
  95. aging is done lazily.
  96. (Query is really a GetCount, Set is really an IncCount)
  97. the cCnt in a UACount is (usually) unaged. it, together w/ the sidMru
  98. give an 'aged' count. on a Query, we age cCnt w.r.t. sidMru to give
  99. a 'real' count. a Query does not update the UACount; it simply computes
  100. what it 'should' be and returns the result.
  101. the only time we actually update a UACount is when we Set it. in that
  102. case, we age it (per Query), add 1, and then store back out the new
  103. (aged) cCnt and the new (now!) sidMru.
  104. we currently don't delete a UACount when it ages to 0 (on Query).
  105. BUGBUG we probably should.
  106. we currently don't scavenge UACounts which would be aged to 0 if queried.
  107. BUGBUG we probably should.
  108. - registry keys
  109. we support the following registry keys (currently just for debugging):
  110. $uassist/Settings/
  111. SessionTime (12 hrs) min time (mins) between sessions
  112. IdleTime (12 hrs) min idle time (mins) before force session
  113. Backup (0) rename keys to "del.xxx" rather than deleting
  114. NoPurge (0) don't auto-delete keys when they decay to 0
  115. NoEncrypt (0) don't encrypt keys
  116. NoLog (0) turn off all logging
  117. Instrument (0) turn on instrumentation (UserAssist2, no decay)
  118. while these could be exposed if we see fit, we should not do so w/o signoff
  119. from PM, dev, qa, and docs (since all would be impacted).
  120. the keys are read once on explorer startup. thus if they're changed you
  121. must restart explorer (e.g. logoff/logon).
  122. - todo (BUGBUG)
  123. version # in UserAssist section! done.
  124. naming: uem* -> ua*
  125. - testing: hooks, utils, etc.
  126. we have several hooks/etc. for testing.
  127. force a new session immediately (simulate a reboot and a 12-hour delay)
  128. set 'SessionTime' regkey to 0 minutes between sessions
  129. alt+F4 to shutdown windows
  130. cancel
  131. force the menus to refresh (simulate a reboot)
  132. turn off intelli-menus
  133. turn back on
  134. 'new session' (above) also does this
  135. turn off all logging (to measure perf hit)
  136. set 'NoLog' regkey to 1
  137. BUGBUG this is obsolescent; fix this!
  138. (NYI: in progress)
  139. there are utils to dump IDMs, etc. these can form the basis for a dump
  140. utility which prints the UAssist data in symbolic form.
  141. - testing: scenarios
  142. ...
  143. - testing: specifics
  144. post-install
  145. - everything should look like it has a count of 1
  146. - after a few sessions, everything which hasn't been clicked since
  147. install should disappear (since the 'default' count will age to 0)
  148. count aging: does it happen correctly
  149. time/count wrap: what happens when various counts wrap
  150. - session id and MRU time
  151. - item count and MRU session
  152. - ctlsession gets deleted/recreated to sid=0, so other counts reference
  153. bigger sids and math goes < 0 (like wrap?)
  154. default counts
  155. missing entries
  156. clicking on a leaf should create entries for it and all grand-parents
  157. extra entries
  158. querying an item should *not* create *any* reg entries
  159. top-level menu should never go away (e.g. docs, pgms, help, etc.).
  160. NYI: regkey should be deleted when count ages down to 0 (to keep size down).
  161. NYI: registry should be scavenged periodically to find 0's.
  162. NYI: reentrancy. e.g. browse in separate process!
  163. NYI: versioning.
  164. NYI: don't up session id on shutdown if it's not already there (for PSS).
  165. - testing: anomalies
  166. this section describes known 'weirdness' in the spec and/or implementation.
  167. it remains to be decided if they're bugs or features.
  168. 1. parent not aged, all kids aged, kids come up blank (chevron only). we've
  169. been debating what to do about this (and how frequent it will be). right
  170. now we're punting (i.e. we're calling this a feature).
  171. 2. installing a program doesn't do anything to the counts. so you can
  172. install office, then bring up the start menu and not see office!
  173. 2b. OEM install is potentially even worse...
  174. 3. (and 2c) moving a menu item leaves the old count orphaned, and creates
  175. no new item.
  176. 4. we're currently using office's definition of a 'session'. we probably
  177. need something better tailored to windows.
  178. 5. logging *must* be off in Germany.