⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kcom.c

📁 ReactOS是一些高手根据Windows XP的内核编写出的类XP。内核实现机理和API函数调用几乎相同。甚至可以兼容XP的程序。喜欢研究系统内核的人可以看一看。
💻 C
字号:
/* ===============================================================    Kernel-mode COM*/#include <windows.h>#include <ntddk.h>#include <ks.h>#include <kcom.h>#include <debug.h>/* http://msdn2.microsoft.com/en-us/library/ms809781.aspx */COMDDKAPI NTSTATUS NTAPIKoCreateInstance(    IN  REFCLSID ClassId,    IN  IUnknown* UnkOuter OPTIONAL,    IN  ULONG ClsContext,    IN  REFIID InterfaceId,    OUT PVOID* Interface){    /* If UnkOuter isn't NULL, it must be IUnknown - TODO: CHECK THIS PARAM */    /* TODO: Check IRQL? */    DPRINT("KoCreateInstance called\n");    if ( ClsContext != CLSCTX_KERNEL_SERVER )    {        DPRINT("FAILED: ClsContext must be CLSCTX_KERNEL_SERVER\n");        return STATUS_INVALID_PARAMETER_3;    }    /*        Find the desired interface and create an instance.          But we also need to supply a        pointer which will be set to a list of available interfaces, to        IoGetDeviceInterfaces.        We can then create a file based on this information and thus talk        to the appropriate device.        Useful references:            http://www.freelists.org/archives/wdmaudiodev/01-2003/msg00023.html        TODO    */    DPRINT("** FAKING SUCCESS **\n");    return STATUS_SUCCESS;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -