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.

66 lines
2.6 KiB

  1. VERSION 5.00
  2. Begin VB.Form Form1
  3. Caption = "Form1"
  4. ClientHeight = 5595
  5. ClientLeft = 60
  6. ClientTop = 345
  7. ClientWidth = 7470
  8. LinkTopic = "Form1"
  9. ScaleHeight = 5595
  10. ScaleWidth = 7470
  11. StartUpPosition = 3 'Windows Default
  12. Begin VB.ListBox List
  13. Height = 3180
  14. Left = 600
  15. TabIndex = 1
  16. Top = 600
  17. Width = 6375
  18. End
  19. Begin VB.CommandButton Start
  20. Caption = "Start"
  21. Height = 615
  22. Left = 2520
  23. TabIndex = 0
  24. Top = 4560
  25. Width = 2655
  26. End
  27. End
  28. Attribute VB_Name = "Form1"
  29. Attribute VB_GlobalNameSpace = False
  30. Attribute VB_Creatable = False
  31. Attribute VB_PredeclaredId = True
  32. Attribute VB_Exposed = False
  33. Dim WithEvents objSink As SWbemSink
  34. Attribute objSink.VB_VarHelpID = -1
  35. Dim Services As SWbemServices
  36. Private Sub Form_Load()
  37. Dim Locator As New WbemScripting.SWbemLocator
  38. Set Services = Locator.ConnectServer("alanbos4", "root\cimv2", "Administrator", "ladolcevita")
  39. Set Services = Locator.ConnectServer("alanbos4", "root\cimv2", "Administrator", "ladolcevita")
  40. End Sub
  41. Private Sub objSink_OnCompleted(ByVal iHResult As WbemScripting.WbemErrorEnum, ByVal objErrorObject As WbemScripting.ISWbemObject, ByVal objAsyncObject As WbemScripting.ISWbemSinkControl, ByVal objAsyncContext As WbemScripting.ISWbemNamedValueSet)
  42. Debug.Print "Completed"
  43. End Sub
  44. Private Sub objSink_OnObjectReady(ByVal objObject As WbemScripting.ISWbemObject, ByVal objAsyncObject As WbemScripting.ISWbemSinkControl, ByVal objAsyncContext As WbemScripting.ISWbemNamedValueSet)
  45. List.AddItem (objObject.Path_.DisplayName)
  46. List.AddItem (objObject.Security_.AuthenticationLevel)
  47. List.AddItem (objObject.Security_.ImpersonationLevel)
  48. End Sub
  49. Private Sub Start_Click()
  50. Services.Security_.AuthenticationLevel = wbemAuthenticationLevelPktPrivacy
  51. Services.Security_.ImpersonationLevel = wbemImpersonationLevelImpersonate
  52. Debug.Print "Before call: " & _
  53. Services.Security_.AuthenticationLevel & ":"; Services.Security_.ImpersonationLevel
  54. Set objSink = Services.InstancesOfAsync("Win32_LogicalDisk")
  55. Services.Security_.AuthenticationLevel = wbemAuthenticationLevelPktIntegrity
  56. Services.Security_.ImpersonationLevel = wbemImpersonationLevelDelegate
  57. Debug.Print "After call:" & _
  58. Services.Security_.AuthenticationLevel & ":"; Services.Security_.ImpersonationLevel
  59. End Sub