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

📄 kernel.odl

📁 The code for this article was written for version 1.0 of the Active Template Library (ATL). The cu
💻 ODL
📖 第 1 页 / 共 4 页
字号:
    HFILE WINAPI OpenFile(LPCSTR lpFileName, LPOFSTRUCT lpReOpenBuff,
                          UINT uStyle);

    BOOL WINAPI WriteFile(HANDLE hFile, LPCVOID lpBuffer,
                          DWORD nNumberOfBytesToWrite,
                          LPDWORD lpNumberOfBytesWritten,
                          LPOVERLAPPED lpOverlapped);

    BOOL WINAPI ReadFile(HANDLE hFile, LPVOID lpBuffer,
                         DWORD nNumberOfBytesToRead,
                         LPDWORD lpNumberOfBytesRead,
                         LPOVERLAPPED lpOverlapped);

    BOOL WINAPI ReadFileEx(HANDLE hFile, LPVOID lpBuffer,
                           DWORD nNumberOfBytesToRead,
                           LPOVERLAPPED lpOverlapped,
                           LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);

    BOOL WINAPI WriteFileEx(HANDLE hFile, LPCVOID lpBuffer,
                            DWORD nNumberOfBytesToWrite,
                            LPOVERLAPPED lpOverlapped,
                            LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);

    BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode,
                                LPVOID lpInBuffer, DWORD nInBufferSize,
                                LPVOID lpOutBuffer, DWORD nOutBufferSize,
                                LPDWORD lpBytesReturned,
                                LPOVERLAPPED lpOverlapped);

    BOOL WINAPI SetEndOfFile(HANDLE hFile);

    DWORD WINAPI SetFilePointer(HANDLE hFile, LONG lDistanceToMove,
                                PLONG lpDistanceToMoveHigh,
                                DWORD dwMoveMethod);

    BOOL WINAPI GetFileTime(HANDLE hFile,
                            LPFILETIME lpCreationTime,
                            LPFILETIME lpLastAccessTime,
                            LPFILETIME lpLastWriteTime);

    BOOL WINAPI SetFileTime(HANDLE hFile,
                            CONST FILETIME *lpCreationTime,
                            CONST FILETIME *lpLastAccessTime,
                            CONST FILETIME *lpLastWriteTime);
    */

    [
    usesgetlasterror,
    entry("CloseHandle"),
    helpstring("Closes an object handle"),
    ]
    BOOL WINAPI CloseHandle([in] HANDLE hObject);

    /*
    BOOL WINAPI DuplicateHandle(HANDLE hSourceProcessHandle,
                                HANDLE hSourceHandle,
                                HANDLE hTargetProcessHandle,
                                LPHANDLE lpTargetHandle,
                                DWORD dwDesiredAccess,
                                BOOL bInheritHandle, DWORD dwOptions);

    BOOL WINAPI GetHandleInformation(HANDLE hObject, LPDWORD lpdwFlags);

    BOOL WINAPI SetHandleInformation(HANDLE hObject, DWORD dwMask,
                                     DWORD dwFlags);

    const DWORD HANDLE_FLAG_INHERIT        = 0x00000001;
    const DWORD HANDLE_FLAG_AUDIT_ON_CLOSE = 0x00000002;

    const int HINSTANCE_ERROR = 32;

    typedef struct _OFSTRUCT {
        BYTE cBytes;
        BYTE fFixedDisk;
        WORD nErrCode;
        WORD Reserved1;
        WORD Reserved2;
        CHAR szPathName[OFS_MAXPATHNAME];
    } OFSTRUCT, *LPOFSTRUCT, *POFSTRUCT;

    */

    // ****** Resource Management *******

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("FindResourceA"),
    #else
    entry("FindResource"),
    #endif
    helpstring("Finds a resource by its name, type, and module; returns a resource handle"),
    ]
    HRSRC   WINAPI FindResourceStrStr([in] HINSTANCE hInst,
                                      [in] LPCSTR lpszName,
                                      [in] LPCSTR lpszType);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("FindResourceA"),
    #else
    entry("FindResource"),
    #endif
    helpstring("Finds a resource by its name, type, and module; returns a resource handle"),
    ]
    HRSRC   WINAPI FindResourceIdStr([in] HINSTANCE hInst,
                                     [in] DWORD dwName,
                                     [in] LPCSTR lpszType);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("FindResourceA"),
    #else
    entry("FindResource"),
    #endif
    helpstring("Finds a resource by its name, type, and module; returns a resource handle"),
    ]
    HRSRC   WINAPI FindResourceStrId([in] HINSTANCE hInst,
                                     [in] LPCSTR lpszName,
                                     [in] DWORD dwType);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("FindResourceA"),
    #else
    entry("FindResource"),
    #endif
    helpstring("Finds a resource by its name, type, and module; returns a resource handle"),
    ]
    HRSRC   WINAPI FindResourceIdId([in] HINSTANCE hInst,
                                    [in] DWORD dwName,
                                    [in] DWORD dwType);


    [
    usesgetlasterror,
    entry("LoadResource"),
    helpstring("Loads a resource handle, returning a global memory handle with the resource"),
    ]
    HGLOBAL WINAPI LoadResource([in] HINSTANCE hInst, [in] HRSRC hrsrc);

    [
    usesgetlasterror,
    entry("FreeResource"),
    helpstring("Frees a loaded resource passed by the handle received from LoadResource"),
    ]
    BOOL    WINAPI FreeResource([in] HGLOBAL hglbResource);

    [
    usesgetlasterror,
    entry("LockResource"),
    helpstring("Locks resource memory block and returns global pointer to it"),
    ]
    LONG WINAPI LockResource([in] HGLOBAL hglbResource);
    // void FAR* WINAPI LockResource([in] HGLOBAL hglbResource);

    /* Note: In Win16 UnlockResource is a macro to GlobalUnlock. We have
       to make it an alias. In Win32 UnlockResource is a macro returning
       zero. We can't do that, so we make an alias to GlobalUnlock and
       hope for the best.
    */

    [
    usesgetlasterror,
    entry("GlobalUnlock"),
    helpstring("Unlocks resource memory block"),
    ]
    BOOL    WINAPI UnlockResource([in] HGLOBAL hglb);


    [
    usesgetlasterror,
    entry("SizeofResource"),
    helpstring("Gets the size in bytes of a resource"),
    ]
    DWORD   WINAPI SizeofResource([in] HINSTANCE hInst, [in] HRSRC hrsrc);

    /* These two deleted from Win32, so not implemented for Win16
    int     WINAPI AccessResource([in] HINSTANCE hInst, [in] HRSRC hrsrc);

    HGLOBAL WINAPI AllocResource([in] HINSTANCE hInst, [in] HRSRC hrsrc, DWORD);
    */

    /* Not implemented
    HRSRC WINAPI FindResourceExA(
        HINSTANCE hModule,
        LPCSTR lpType,
        LPCSTR lpName,
        WORD    wLanguage
        );

    typedef FARPROC ENUMRESTYPEPROC;
    typedef FARPROC ENUMRESNAMEPROC;
    typedef FARPROC ENUMRESLANGPROC;

    BOOL WINAPI EnumResourceTypesA(
        HINSTANCE hModule,
        ENUMRESTYPEPROC lpEnumFunc,
        LONG lParam
        );

    BOOL WINAPI EnumResourceNamesA(
        HINSTANCE hModule,
        LPCSTR lpType,
        ENUMRESNAMEPROC lpEnumFunc,
        LONG lParam
        );

    BOOL WINAPI EnumResourceLanguagesA(
        HINSTANCE hModule,
        LPCSTR lpType,
        LPCSTR lpName,
        ENUMRESLANGPROC lpEnumFunc,
        LONG lParam
        );

    HANDLE WINAPI BeginUpdateResourceA(
        LPCSTR pFileName,
        BOOL bDeleteExistingResources
        );

    BOOL WINAPI UpdateResourceA(
        HANDLE      hUpdate,
        LPCSTR     lpType,
        LPCSTR     lpName,
        WORD        wLanguage,
        LPVOID      lpData,
        DWORD       cbData
        );

    BOOL WINAPI EndUpdateResourceA(
        HANDLE      hUpdate,
        BOOL        fDiscard
        );
    */

    /*
    // OEM Resource Ordinal Numbers
    const long OBM_CLOSE           = 32754;
    const long OBM_UPARROW         = 32753;
    const long OBM_DNARROW         = 32752;
    const long OBM_RGARROW         = 32751;
    const long OBM_LFARROW         = 32750;
    const long OBM_REDUCE          = 32749;
    const long OBM_ZOOM            = 32748;
    const long OBM_RESTORE         = 32747;
    const long OBM_REDUCED         = 32746;
    const long OBM_ZOOMD           = 32745;
    const long OBM_RESTORED        = 32744;
    const long OBM_UPARROWD        = 32743;
    const long OBM_DNARROWD        = 32742;
    const long OBM_RGARROWD        = 32741;
    const long OBM_LFARROWD        = 32740;
    const long OBM_MNARROW         = 32739;
    const long OBM_COMBO           = 32738;
    const long OBM_UPARROWI        = 32737;
    const long OBM_DNARROWI        = 32736;
    const long OBM_RGARROWI        = 32735;
    const long OBM_LFARROWI        = 32734;

    const long OBM_OLD_CLOSE       = 32767;
    const long OBM_SIZE            = 32766;
    const long OBM_OLD_UPARROW     = 32765;
    const long OBM_OLD_DNARROW     = 32764;
    const long OBM_OLD_RGARROW     = 32763;
    const long OBM_OLD_LFARROW     = 32762;
    const long OBM_BTSIZE          = 32761;
    const long OBM_CHECK           = 32760;
    const long OBM_CHECKBOXES      = 32759;
    const long OBM_BTNCORNERS      = 32758;
    const long OBM_OLD_REDUCE      = 32757;
    const long OBM_OLD_ZOOM        = 32756;
    const long OBM_OLD_RESTORE     = 32755;

    const long OCR_NORMAL          = 32512;
    const long OCR_IBEAM           = 32513;
    const long OCR_WAIT            = 32514;
    const long OCR_CROSS           = 32515;
    const long OCR_UP              = 32516;
    const long OCR_SIZE            = 32640;
    const long OCR_ICON            = 32641;
    const long OCR_SIZENWSE        = 32642;
    const long OCR_SIZENESW        = 32643;
    const long OCR_SIZEWE          = 32644;
    const long OCR_SIZENS          = 32645;
    const long OCR_SIZEALL         = 32646;
    const long OCR_ICOCUR          = 32647;

    const long OIC_SAMPLE          = 32512;
    const long OIC_HAND            = 32513;
    const long OIC_QUES            = 32514;
    const long OIC_BANG            = 32515;
    const long OIC_NOTE            = 32516;
    */

    // ****** Atom Management *******

    /*
    BOOL    WINAPI InitAtomTable(int);
    ATOM    WINAPI AddAtom(LPCSTR);
    ATOM    WINAPI DeleteAtom(ATOM);
    ATOM    WINAPI FindAtom(LPCSTR);
    UINT    WINAPI GetAtomName(ATOM, LPSTR, int);
    ATOM    WINAPI GlobalAddAtom(LPCSTR);
    ATOM    WINAPI GlobalDeleteAtom(ATOM);
    ATOM    WINAPI GlobalFindAtom(LPCSTR);
    UINT    WINAPI GlobalGetAtomName(ATOM, LPSTR, int);
    HLOCAL  WINAPI GetAtomHandle(ATOM);
    */

    // ****** WIN.INI Support ******

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("GetProfileIntA"),
    #else
    entry("GetProfileIntA"),
    #endif
    helpstring("Gets an integer value from given entry within given section of WIN.INI (or default if not found)"),
    ]
    UINT    WINAPI GetProfileInt([in] LPCSTR lpszSection,
                                 [in] LPCSTR lpszEntry,
                                 [in] int iDef);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("GetProfileStringA"),
    #else
    entry("GetProfileString"),
    #endif
    helpstring("Gets a string value from given entry within given section of WIN.INI (or default if not found)"),
    ]
    int     WINAPI GetProfileString([in] LPCSTR lpszSection,
                                    [in] LPCSTR lpszEntry,
                                    [in] LPCSTR lpszDefault,
                                    [in, out] LPSTR lpszReturnBuffer,
                                    [in] int cbReturnBuffer);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("WriteProfileStringA"),
    #else
    entry("WriteProfileString"),
    #endif
    helpstring("Writes given string value to given entry within given section of WIN.INI"),
    ]
    BOOL    WINAPI WriteProfileString([in] LPCSTR lpszSection,
                                      [in] LPCSTR lpszEntry,
                                      [in] LPCSTR lpszString);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("GetPrivateProfileIntA"),
    #else
    entry("GetPrivateProfileIntA"),
    #endif
    helpstring("Gets an integer value from given entry within given section of INI file (or default if not found)"),
    ]
    UINT    WINAPI GetPrivateProfileInt([in] LPCSTR lpszSection,
                                        [in] LPCSTR lpszEntry,
                                        [in] int iDef,
                                        [in] LPCSTR lpszFilename);

    [
    #ifdef WIN32
    usesgetlasterror,

⌨️ 快捷键说明

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