winsvc | Windows service library written in go - Forked from http
kandi X-RAY | winsvc Summary
kandi X-RAY | winsvc Summary
Package winsvc is simply a fork from As can be guessed from the name, it only works on Windows.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Run starts a service .
- Runs the service
- IsAnInteractiveSession returns true if the user is an interactive session .
- controlService is used to control a service
- Install a key file
- installService installs a service
- exePath returns the executable path .
- runService runs the service .
- removeService removes a service
- newCallback wraps a function with a function call .
winsvc Key Features
winsvc Examples and Code Snippets
Community Discussions
Trending Discussions on winsvc
QUESTION
The code below, via...
...ANSWER
Answered 2021-Nov-16 at 12:45TService is derived from TDataModule, so OnCreate will be called when the TService instance is created. That obviously happens when the service is going to be started, but also when it is installed and uninstalled.
So, no, it is not a bug and you also should not prevent it.
Perhaps it is just that your expectations are wrong?
QUESTION
--Want to Add insert data into Azure storage cluster using stream method. --Ingestion client is generated but when try to insert new record into cluster table than it is giving error for authroization, Note i have added my account to access table and also give permission to ingest data Though other than these please let me know if any thing pending to ingest data or any reference link to ingest data in to azure cluster storage
...ANSWER
Answered 2021-Mar-03 at 14:16The error indicates that you do not have permission to ingest data into the specific table you are trying to ingest the data to.
Please note that a person with "user" access, cannot ingest data to a table that was not created by that person.
Please ensure that your identity has "ingestor" permission on the specific table or for the database. You can do it through the Azure portal or using the applicable commands.
QUESTION
I have a Windows service that run in NT AUTHORITY\SYSTEM
(SERVICE_WIN32_OWN_PROCESS
) account during system startup.
Now i have a doubt:
Suppose that i want change the way of automatic execution to TaskScheduler.
TaskScheduler will execute my service normally like before and mainly in NT AUTHORITY\SYSTEM
account?
ANSWER
Answered 2021-Feb-19 at 17:13TaskScheduler doesn't directly support running services, but you can use a command-line operation to instruct the SCM to start the service (ie, net start ""
). You can use whatever account you want to run the operation, but the account that the service will use is specified in the service's own configuration. The SCM will simply run the service in whatever account has been configured. That will be NT AUTHORITY\SYSTEM
by default, if another account is not specified.
QUESTION
A Windows service of type WIN32_SHARE_PROCESS
(0x20
) runs as a thread in a process which it shares with other services. (Although, in recent Windows 10 builds, it may get its own process anyway.) A Windows service of type WIN32_OWN_PROCESS
(0x10
) runs in its own isolated process. But, some Windows services have type wIN32_OWN_PROCESS | WIN32_SHARE_PROCESS
(0x30
). What does that combination mean?
sc query
calls that combination WIN32
. For example, sc query AppInfo
reports:
ANSWER
Answered 2021-Jan-27 at 15:53As you point out, changes to service host grouping in Windows 10 may result in services of type SERVICE_WIN32_SHARE_PROCESS running in their own, isolated process. Whenever that happens to a service, SC will show it as SERVICE_WIN32 -- the confusing union of SERVICE_WIN32_OWN_PROCESS and SERVICE_WIN32_SHARE_PROCESS.
We've confirmed this situation by playing with the registry.
On our Windows 10 VM (which has ample RAM to trigger the process isolation enhancements), SC says AppInfo is of type WIN32 (30):
Task Manager reported that AppInfo was running in its own process.
As per the documentation, we disabled process isolation for the AppInfo service by adding the SvcHostSplitDisable value:
And after a reboot, SC reported AppInfo of type WIN32_SHARE_PROCESS (20):
The Task Manager confirmed that the process was indeed shared.
So its all down to those changes to service process isolation in Windows 10 Creators Update (version 1703).
QUESTION
I am trying to execute an external program under SYSTEM
level and I applied this method (where I only changed the CreateProcessAsSystem('c:\windows\system32\cmd.exe');
to the path of the application I wanted to execute) and it works perfectly as expected only if there is one user logged into the pc.
Eg. I have 2 users (user1
and user2
) and both users are logged in (user1
first and then user2
). Then, I run the program in user2
and my external program supposed to appear on user2
's desktop. However, it appears on user1
's desktop. Can I know what causes this to happen and how can I solve this?
Problem reproduction:
- Create two users (
user1
anduser2
) - Logged in to
user1
first and thenuser2
- Run the program in
user2
Code:
TestSystem.pas
...ANSWER
Answered 2021-Jan-05 at 04:45I have faced the same problem as you and the problem is caused from your ProcessIDFromAppname32('winlogon.exe')
as it keeps retrieving the process ID of the first logged in user's session ID. You can try adding in this code snippet to compare and get the process ID of the currently logged in user's session ID.
QUESTION
According to the MSDN documentation on lpMachineName
param of OpenSCManager
WinApi function:
If the pointer is NULL or points to an empty string, the function connects to the service control manager on the local computer.
Is passing "localhost" or "127.0.0.1" will result the exact same behavior as passing NULL or an empty string? Or should I perform a check in my logic and substitute "localhost" or "127.0.0.1" with NULL, before calling OpenSCManager
?
ANSWER
Answered 2020-Dec-01 at 09:52OpenSCManager of course uses a special, fast path, to connect to the local service control manager. for use this fast path OpenSCManager need somehow detect that we want connect to local database. this of course done by check lpMachineName. the best and documented variant - will be use NULL pointer here. then almost same effect will be if use empty string. then possible OpenSCManager can compare lpMachineName with some hard-coded strings. in my test, it compare lpMachineName with localhost and . and if not match - need go to slow path. for 127.0.0.1 string function not check.
for compare fast and slow path, some internal fragments of OpenSCManager :
fast path: (here and selected path)
slow path:
fast path:
slow path:
fast path:
slow path:
QUESTION
I work on an Python application that queries data from Kusto using the azure-kusto-data library (https://pypi.org/project/azure-kusto-data/)
I am trying to write a kusto function to execute a particular function. This function takes in 2 inputs, a datatable input and a timespan input
So as an example:
Function Name: GenerateSomeOutputviaKusto Function Parameters: (T:(Env:string,Something:string,StartDate:datetime),inputGranularity:timespan)
As you can see, this function input uses a tabular input. Now in order to properly call this function (in say, KustoExplorer), I use a "let" statement in order to create the tabular input for this function, following the guidance from this page: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/letstatement
...ANSWER
Answered 2020-Nov-20 at 18:19The issue is that you're trying to pass non-constant scalar values to the datatable
operator - that's not supported, regardless of using query parameters or not.
you could replace your usage of the datatable
operator with print
, for example:
QUESTION
I have a kernel driver written in C, where it is expecting a text of type PCWSTR
. What's the Delphi type equivalent to send a control code? I tried sending using the following code but GetLastError
reports ERROR_NOACCESS
. How to solve that?
ANSWER
Answered 2020-Jul-21 at 06:39While calling DeviceIOControl(IOCTL_PATH_DELETE)
, when you pass in szInput
and szOutput
, you are type-casting a single WideChar
to a PWideChar
, so whatever numeric value that WideChar
contains will be mis-interpreted as a memory address, which is wrong. So you end up passing in invalid memory addresses, which can easily account for the ERROR_NOACCESS
error.
Change PWideChar(szInput[0])
to PWideChar(@szInput[0])
or simply get rid of the type-cast altogether, passing @szInput
as-is. Same with szOutput
.
QUESTION
I have the following code for ingesting data into Azure Data Explore using Python in Databricks:
...ANSWER
Answered 2020-Jun-28 at 05:41It is likely that your connection has the engine endpoint instead of the data management endpoint. Can you check that the connection to the cluster starts with "ingest-"? See here an example:
client = KustoIngestClient("https://ingest-{cluster_name}.kusto.windows.net")
QUESTION
I`m trying to write a windows service application, it is running just fine, but weird things happen when I try to stop it.
...ANSWER
Answered 2020-Mar-22 at 20:32Each call to SetServiceStatus()
tells the SCM what controls your service is prepared to receive. Likely your last call to SetServiceStatus()
set dwControlsAccepted
to 0 rather than a mask of reasonable values for a running service (SERVICE_ACCEPT_STOP
at the very least).
Update the call where you set dwCurrentState
to SERVICE_RUNNING
so that dwControlsAccepted
includes SERVICE_ACCEPT_STOP
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install winsvc
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page