mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
src: dotnet: testing
This commit is contained in:
parent
964f2eed69
commit
4d6fc3c848
@ -47,24 +47,27 @@ namespace Fsp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* control */
|
/* control */
|
||||||
public void Run()
|
public int Run()
|
||||||
{
|
{
|
||||||
if (IntPtr.Zero == _Service)
|
if (IntPtr.Zero == _Service)
|
||||||
{
|
{
|
||||||
|
const Int32 STATUS_INSUFFICIENT_RESOURCES = unchecked((Int32)0xc000009a);
|
||||||
Log(EVENTLOG_ERROR_TYPE,
|
Log(EVENTLOG_ERROR_TYPE,
|
||||||
String.Format("The service {0} cannot be created (Status={1:X}).",
|
String.Format("The service {0} cannot be created (Status={1:X}).",
|
||||||
GetType().FullName, unchecked((Int32)0xc000009a)/*STATUS_INSUFFICIENT_RESOURCES*/));
|
GetType().FullName, STATUS_INSUFFICIENT_RESOURCES));
|
||||||
return;
|
return (int)Api.FspWin32FromNtStatus(STATUS_INSUFFICIENT_RESOURCES);
|
||||||
}
|
}
|
||||||
Api.FspServiceAllowConsoleMode(_Service);
|
Api.FspServiceAllowConsoleMode(_Service);
|
||||||
Int32 Result = Api.FspServiceLoop(_Service);
|
Int32 Result = Api.FspServiceLoop(_Service);
|
||||||
|
int ExitCode = (int)Api.FspServiceGetExitCode(_Service);
|
||||||
if (0 > Result)
|
if (0 > Result)
|
||||||
{
|
{
|
||||||
Log(EVENTLOG_ERROR_TYPE,
|
Log(EVENTLOG_ERROR_TYPE,
|
||||||
String.Format("The service {0} has failed to run (Status={1:X}).",
|
String.Format("The service {0} has failed to run (Status={1:X}).",
|
||||||
GetType().FullName, Result));
|
GetType().FullName, Result));
|
||||||
return;
|
return (int)Api.FspWin32FromNtStatus(Result);
|
||||||
}
|
}
|
||||||
|
return ExitCode;
|
||||||
}
|
}
|
||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
|
@ -37,9 +37,9 @@ namespace passthrough
|
|||||||
|
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static int Main(string[] args)
|
||||||
{
|
{
|
||||||
new PtfsService().Run();
|
return new PtfsService().Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user