📄 loadrtdll.c
字号:
/*++
*
* Copyright (c) 1998-2005, Ardence, Inc. All rights reserved.
*
* Module Name:
*
* LoadRtdll.c
*
* Abstract:
*
* A simple utility to load a RTDLL
*
*
* Environment:
*
* RTX application (RTSS).
*
* Revision History:
*
* Appended exit from this program (LT)
*
*
--*/
#include <windows.h>
#include <stdio.h>
#include <rtapi.h>
#define NO_ERRORS 0
#define ERROR_OCCURED -1
int main(int argc, char* argv[])
{
HANDLE hLibModule = NULL;
LPCSTR lpLibFileName = "rtdllexample.dll";
//load Library sampleRtdll
hLibModule = LoadLibrary(lpLibFileName);
//check if loadLibrary returned correctly
if(hLibModule==NULL)
{
//error caused by loading a corrupt or unregistered Rtdll
RtPrintf("LoadRtdll: ERROR: LoadLibrary() failed. Get last Error = %d\n", GetLastError());
RtPrintf("%s maybe corrupt or not registered with RTSS\n", lpLibFileName);
return (ERROR_OCCURED);
}
// Before exit, wait 3 sec. to let start "TestRtdll.rtss" process
Sleep(3000);
// Even program exits now - "rtdllexample.dll" will not be unloaded unless all
// "TestRtdll.rtss" processes finish
return (NO_ERRORS);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -