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.

193 lines
5.4 KiB

  1. VERSION 5.00
  2. Begin VB.Form CertVwr
  3. Caption = "Certificate Authority Viewer"
  4. ClientHeight = 7050
  5. ClientLeft = 60
  6. ClientTop = 345
  7. ClientWidth = 8100
  8. LinkTopic = "Form1"
  9. ScaleHeight = 7050
  10. ScaleWidth = 8100
  11. StartUpPosition = 3 'Windows Default
  12. Begin VB.CommandButton ViewLog
  13. Caption = "View Log"
  14. Height = 375
  15. Left = 1800
  16. TabIndex = 5
  17. Top = 6000
  18. Visible = 0 'False
  19. Width = 1455
  20. End
  21. Begin VB.CommandButton ViewQueue
  22. Caption = "View Schema"
  23. Default = -1 'True
  24. Height = 375
  25. Left = 240
  26. TabIndex = 4
  27. Top = 6000
  28. Width = 1455
  29. End
  30. Begin VB.Frame CAFrame
  31. Caption = "Certificate Authority"
  32. Height = 975
  33. Left = 240
  34. TabIndex = 2
  35. Top = 240
  36. Width = 4335
  37. Begin VB.ComboBox CACombo
  38. Height = 315
  39. Left = 240
  40. TabIndex = 3
  41. Top = 360
  42. Width = 3855
  43. End
  44. End
  45. Begin VB.CommandButton ExitButton
  46. Cancel = -1 'True
  47. Caption = "Exit"
  48. Height = 375
  49. Left = 3360
  50. TabIndex = 1
  51. Top = 6000
  52. Width = 1215
  53. End
  54. Begin VB.ListBox SchemaList
  55. Columns = 3
  56. Height = 3765
  57. Left = 240
  58. TabIndex = 0
  59. Top = 1800
  60. Width = 7575
  61. End
  62. Begin VB.Label MengthLabel
  63. Caption = "Maximum Length"
  64. Height = 255
  65. Left = 5280
  66. TabIndex = 8
  67. Top = 1560
  68. Width = 1575
  69. End
  70. Begin VB.Label TypeLabel
  71. Caption = "Type"
  72. Height = 495
  73. Left = 2760
  74. TabIndex = 7
  75. Top = 1560
  76. Width = 1815
  77. End
  78. Begin VB.Label NameLabel
  79. Caption = "Column Name"
  80. Height = 375
  81. Left = 240
  82. TabIndex = 6
  83. Top = 1560
  84. Width = 1815
  85. End
  86. End
  87. Attribute VB_Name = "CertVwr"
  88. Attribute VB_GlobalNameSpace = False
  89. Attribute VB_Creatable = False
  90. Attribute VB_PredeclaredId = True
  91. Attribute VB_Exposed = False
  92. Private Sub ExitButton_Click()
  93. End
  94. End Sub
  95. Private Sub Form_Load()
  96. Dim Config As CCertConfig
  97. Dim ConfigStr As String
  98. Dim r As Long
  99. Dim i As Long
  100. Set Config = New CCertConfig
  101. i = 0
  102. Do While True
  103. r = Config.Next
  104. If (-1 = r) Then Exit Do
  105. ConfigStr = Config.GetField("Config")
  106. 'ConfigStr = ConfigStr & Config.GetField("Comment")
  107. If (0 = i) Then CACombo.Text = ConfigStr
  108. CACombo.AddItem ConfigStr, i
  109. i = i + 1
  110. Loop
  111. Set Config = Nothing
  112. End Sub
  113. Private Sub ViewQueue_Click()
  114. Dim CertView As CCertView
  115. Dim EnumCol As CEnumCERTVIEWCOLUMN
  116. Dim ColStr As String
  117. Dim ccol As Long
  118. Dim ccolTotal As Long
  119. Dim icol As Long
  120. Dim coltype As Long
  121. Dim idx As Long
  122. Dim chunk As Long
  123. Dim length As Long
  124. chunk = 17
  125. Set CertView = New CCertView
  126. Set EnumCol = Nothing
  127. CertView.OpenConnection CACombo.Text
  128. ccolTotal = CertView.GetColumnCount(False)
  129. Set EnumCol = CertView.EnumCertViewColumn(False)
  130. SchemaList.Clear
  131. ccol = ccolTotal
  132. While (0 <> ccol)
  133. icol = EnumCol.Next()
  134. If (-1 = icol) Then MsgBox ("Bad column index")
  135. ColStr = EnumCol.GetName()
  136. idx = Int(icol / chunk) * chunk * 2
  137. 'MsgBox "Name = " & icol + idx
  138. SchemaList.AddItem ColStr, icol + idx
  139. 'While (32 > Len(ColStr))
  140. 'ColStr = ColStr & " "
  141. 'Wend
  142. coltype = EnumCol.GetType()
  143. If (1 = coltype) Then
  144. ColStr = "Long"
  145. ElseIf (2 = coltype) Then
  146. ColStr = "Date"
  147. ElseIf (3 = coltype) Then
  148. ColStr = "Binary"
  149. ElseIf (4 = coltype) Then
  150. ColStr = "String"
  151. Else
  152. ColStr = "Type=" & coltyp
  153. End If
  154. 'MsgBox "idx = " & idx & " Type = " & (2 * icol) + 1 + idx / 2
  155. SchemaList.AddItem ColStr, (2 * icol) + 1 + idx / 2
  156. length = EnumCol.GetMaxLength()
  157. 'If (0 <> length) Then
  158. 'MsgBox "Len = " & 3 * icol + 2
  159. SchemaList.AddItem length, 3 * icol + 2
  160. ccol = ccol - 1
  161. Wend
  162. ccolListTotal = Int((ccolTotal + chunk - 1) / chunk) * chunk
  163. ccolFragment = ccolListTotal - ccolTotal
  164. idx = 3 * (ccolTotal - (chunk - ccolFragment)) + ccolFragment - 1
  165. For icol = ccolTotal To ccolListTotal - 1
  166. SchemaList.AddItem "", idx
  167. Next icol
  168. idx = idx + chunk
  169. For icol = ccolTotal To ccolListTotal - 1
  170. SchemaList.AddItem "", idx
  171. Next icol
  172. Set EnumCol = Nothing
  173. Set CertView = Nothing
  174. End Sub