-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAspi.cpp
More file actions
36 lines (29 loc) · 817 Bytes
/
Aspi.cpp
File metadata and controls
36 lines (29 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "Extra.h"
#include "stdafx.h"
#include "Stdio.h"
#include "Stdlib.h"
#include "String.h"
//#include "CDVDMain.h"
DWORD (*_ptr_GetASPI32SupportInfo)(VOID);
DWORD (*_ptr_SendASPI32Command)(LPSRB);
// Initializes WNASPI32.DLL
// It really does not matter that this doesn't intend on ever freeing the
// library. It even discards the return value of LoadLibrary.
DWORD InitASPI(void)
{
HINSTANCE handle;
DWORD temp;
handle = LoadLibrary (WNASPI32_DLL);
if (!handle)
{
temp = GetLastError();
return (!temp) ? 1 : temp;
}
_ptr_GetASPI32SupportInfo = (DWORD (*)(VOID)) GetProcAddress(handle,
"GetASPI32SupportInfo");
_ptr_SendASPI32Command = (DWORD (*)(LPSRB)) GetProcAddress(handle,
"SendASPI32Command");
if (!_ptr_GetASPI32SupportInfo || !_ptr_SendASPI32Command)
return 1;
return 0;
}