📄 devinfo.c
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
// -----------------------------------------------------------------------------
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// -----------------------------------------------------------------------------
#include <windows.h>
#include <x86boot.h>
#include <kitl.h>
#include <oal_args.h>
#include <oal_nkxp.h>
extern LPCWSTR g_oalIoCtlPlatformType;
VOID* OALArgsQuery(UINT32 type)
{
return (OAL_ARGS_QUERY_DEVID == type)? (VOID*)g_pX86Info->szDeviceName: NULL;
}
BOOL x86IoCtlHalSetDeviceInfo (
UINT32 code, VOID *lpInBuf, UINT32 nInBufSize, VOID *lpOutBuf,
UINT32 nOutBufSize, UINT32 *lpBytesReturned
) {
static WCHAR szPlatformType[80]; // max of 80 chars
if ((nInBufSize > sizeof (DWORD))
&& (SPI_GETPLATFORMTYPE == *(LPDWORD)lpInBuf)
&& ((nInBufSize -= sizeof (DWORD)) <= sizeof (szPlatformType))) {
memcpy (szPlatformType, ((LPBYTE)lpInBuf)+sizeof(DWORD), nInBufSize);
g_oalIoCtlPlatformType = szPlatformType;
return TRUE;
}
NKSetLastError (ERROR_INVALID_PARAMETER);
return FALSE;
}
BOOL x86IoCtlHalGetUUID (
UINT32 code, VOID *lpInBuf, UINT32 nInBufSize, VOID *lpOutBuf,
UINT32 nOutBufSize, UINT32 *lpBytesReturned
) {
DWORD dwErr = ERROR_INVALID_PARAMETER;
if (lpOutBuf && (nOutBufSize >= sizeof(GUID))) {
USHORT *wMac = g_pX86Info->wMac;
if (lpBytesReturned) {
*lpBytesReturned = sizeof(GUID);
}
// OEM's with unique ID hardware can return the value here.
// The CEPC platform does not have any unique ID settings.
// We'll use the Kernel Ethernet Debug address if non-zero
if (wMac[0] | wMac[1] | wMac[2]) {
memset(lpOutBuf, 0, sizeof(GUID));
memcpy(lpOutBuf, (char *)wMac, sizeof(g_pX86Info->wMac));
return TRUE;
}
dwErr = ERROR_NOT_SUPPORTED;
}
NKSetLastError (dwErr);
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -