Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] OpenService WINAPI function

From: ptretter:charter at: 24-May-2003 12:32

Clear DayIn working with the Service Control Manager on XP. I used CreateProcess to successful create a service called "Unreal One" However, I dont have an actual service program called "Unreal One" therefore I wanted to delete the service. However, my methods have failed. Here is what I tried: ------------------------------------ DEL: to-integer #{010000} SC_MANAGER_ALL_ACCESS: to-integer first reduce [ #{0000} or #{0001} or #{0002} or #{0004} or #{0008} or #{0010} or #{0020} ] winlib: load/library %advapi32.dll openscmanager: make routine! [ lpMachineName [integer!] lpDatabaseName [integer!] dwDesiredAccess [long] return: [integer!] ] winlib "OpenSCManagerA" openscmanager-ret: openscmanager 0 0 SC_MANAGER_ALL_ACCESS openservice: make routine! [ hSCManager [integer!] lpServiceName [string!] dwDesiredAccess [integer!] ] winlib "OpenServiceA" openservice-ret: openservice openscmanager-ret "Unreal one^@" DEL ------------------------------------------------------------------------------------- Here is the error I get: ** Script Error: openservice-ret needs a value ** Near: openservice-ret: openservice openscmanager-ret "Unreal one^@" DEL I have read over the winapi details repeatedly and not sure what the problem is. I successfully get the returned handle to the Service Control Manager Database. Any ideas? Paul Tretter