mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
inc: winfsp.h: FspLoad
This commit is contained in:
parent
acf6ce1008
commit
7425eba8af
@ -76,7 +76,7 @@ Then add the following lines in the beginning of `wmain`:
|
|||||||
.`*wmain excerpt*`
|
.`*wmain excerpt*`
|
||||||
[source,c]
|
[source,c]
|
||||||
----
|
----
|
||||||
if (!NT_SUCCESS(FspLoad()))
|
if (!NT_SUCCESS(FspLoad(0)))
|
||||||
return ERROR_DELAY_LOAD_FAILED;
|
return ERROR_DELAY_LOAD_FAILED;
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@ -1630,7 +1630,7 @@ FSP_API NTSTATUS FspCallNamedPipeSecurely(PWSTR PipeName,
|
|||||||
* Delay load
|
* Delay load
|
||||||
*/
|
*/
|
||||||
static inline
|
static inline
|
||||||
NTSTATUS FspLoad(VOID)
|
NTSTATUS FspLoad(PVOID *PModule)
|
||||||
{
|
{
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
#define FSP_DLLNAME "winfsp-x64.dll"
|
#define FSP_DLLNAME "winfsp-x64.dll"
|
||||||
@ -1645,6 +1645,9 @@ NTSTATUS FspLoad(VOID)
|
|||||||
LONG Result;
|
LONG Result;
|
||||||
HMODULE Module;
|
HMODULE Module;
|
||||||
|
|
||||||
|
if (0 != PModule)
|
||||||
|
*PModule = 0;
|
||||||
|
|
||||||
Module = LoadLibraryW(L"" FSP_DLLNAME);
|
Module = LoadLibraryW(L"" FSP_DLLNAME);
|
||||||
if (0 == Module)
|
if (0 == Module)
|
||||||
{
|
{
|
||||||
@ -1666,6 +1669,9 @@ NTSTATUS FspLoad(VOID)
|
|||||||
return STATUS_DLL_NOT_FOUND;
|
return STATUS_DLL_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (0 != PModule)
|
||||||
|
*PModule = Module;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
#undef FSP_DLLNAME
|
#undef FSP_DLLNAME
|
||||||
|
@ -525,5 +525,5 @@ static int maperror(int winerrno)
|
|||||||
|
|
||||||
long WinFspLoad(void)
|
long WinFspLoad(void)
|
||||||
{
|
{
|
||||||
return FspLoad();
|
return FspLoad(0);
|
||||||
}
|
}
|
||||||
|
@ -918,7 +918,7 @@ static NTSTATUS SvcStop(FSP_SERVICE *Service)
|
|||||||
|
|
||||||
int wmain(int argc, wchar_t **argv)
|
int wmain(int argc, wchar_t **argv)
|
||||||
{
|
{
|
||||||
if (!NT_SUCCESS(FspLoad()))
|
if (!NT_SUCCESS(FspLoad(0)))
|
||||||
return ERROR_DELAY_LOAD_FAILED;
|
return ERROR_DELAY_LOAD_FAILED;
|
||||||
|
|
||||||
return FspServiceRun(L"" PROGNAME, SvcStart, SvcStop, 0);
|
return FspServiceRun(L"" PROGNAME, SvcStart, SvcStop, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user