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

📄 winbase.odl

📁 The code for this article was written for version 1.0 of the Active Template Library (ATL). The cu
💻 ODL
📖 第 1 页 / 共 4 页
字号:

#ifdef WIN32
[
uuid(54674048-3A82-101B-8181-00AA003743D3),
helpstring("Win32 Base Functions"),
dllname("KERNEL32.DLL")
]
module WinBase {


    [
    usesgetlasterror,
    entry("SearchPathA"),
    helpstring("Searches lpPath for lpFileName with lpfExtension and returns full path result in lpBuffer and lpFilePart"),
    ]
    DWORD WINAPI SearchPath([in] LPCSTR lpPath, [in] LPCSTR lpFileName,
                            [in] LPCSTR lpExtension,
                            [in] DWORD nBufferLength,
                            [in, out] LPSTR lpBuffer,
                            [in, out] DWORD FAR *lpFilePart);

    [
    usesgetlasterror,
    entry("GetFullPathNameA"),
    helpstring("Returns full path of lpFileName in lpBuffer and lpFilePart"),
    ]
    DWORD WINAPI GetFullPathName([in] LPCSTR lpFileName,
                                 [in] DWORD nBufferLength,
                                 [in, out] LPSTR lpBuffer,
                                 [in, out] DWORD FAR *lpFilePart);

    [
    usesgetlasterror,
    entry("GetDiskFreeSpaceA"),
    helpstring("Returns information about disk lpRootPathName in lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters"),
    ]
    BOOL WINAPI GetDiskFreeSpace([in] LPCSTR lpRootPathName,
                                 [in, out] DWORD FAR *lpSectorsPerCluster,
                                 [in, out] DWORD FAR *lpBytesPerSector,
                                 [in, out] DWORD FAR *lpNumberOfFreeClusters,
                                 [in, out] DWORD FAR *lpTotalNumberOfClusters);

    [
    usesgetlasterror,
    entry("GetDriveTypeA"),
    helpstring("Returns the type of disk lpRootPathName"),
    ]
    UINT WINAPI GetDriveType([in]LPCSTR lpRootPathName);

    [
    usesgetlasterror,
    entry("GetTempPathA"),
    helpstring("Returns the directory for temporary files in lpBuffer"),
    ]
    DWORD WINAPI GetTempPath([in] DWORD nBufferLength,
                             [in,out] LPSTR lpBuffer);

    [
    usesgetlasterror,
    entry("GetTempFileNameA"),
    helpstring("Returns name of a unique file with lpPrefixString for directory lpPathName in lpTempfileName"),
    ]
    UINT WINAPI GetTempFileName([in] LPCSTR lpPathName,
                                [in] LPCSTR lpPrefixString,
                                [in] UINT uUnique,
                                [in, out] LPSTR lpTempFileName);

    [
    usesgetlasterror,
    entry("GetLogicalDriveStringsA"),
    helpstring("Returns root path strings (with terminating double null) for all valid drives in lpBuffer"),
    ]
    DWORD WINAPI GetLogicalDriveStrings([in] DWORD nBufferLength,
                                        [in, out] LPSTR lpBuffer);

    [
    usesgetlasterror,
    entry("GetLogicalDrives"),
    helpstring("Returns valid lettered drives in bit field (A in bit 0)"),
    ]
    DWORD WINAPI GetLogicalDrives(VOID);

    [
    usesgetlasterror,
    entry("GetEnvironmentStrings"),
    helpstring("Returns pointer to environment variable strings (with terminating double null)"),
    ]
    DWORD WINAPI GetEnvironmentStrings(VOID);

    [
    usesgetlasterror,
    entry("GetEnvironmentVariableA"),
    helpstring("Returns contents of environment variable lpName in lpBuffer"),
    ]
    DWORD WINAPI GetEnvironmentVariable([in] LPCSTR lpName,
                                        [in, out] LPSTR lpBuffer,
                                        [in] DWORD nSize
                                        );

    [
    usesgetlasterror,
    entry("SetEnvironmentVariableA"),
    helpstring("Sets environment variable lpName to value lpValue (deletes variable if lpValue is Null)"),
    ]
    BOOL WINAPI SetEnvironmentVariable([in] LPCSTR lpName,
                                       [in] LPCSTR lpValue);

    [
    usesgetlasterror,
    entry("SetEnvironmentVariableA"),
    helpstring("Sets environment variable lpName to value lpValue (deletes variable if lpValue is Null)"),
    ]
    BOOL WINAPI SetEnvVariable([in] LPCSTR lpName,
                               [in] LPCSTR lpValue);
    [
    usesgetlasterror,
    entry("GetLastError"),
    helpstring("Returns the number of the last error to occur"),
    ]
    DWORD WINAPI GetLastError(VOID);

    [
    usesgetlasterror,
    entry("SetLastError"),
    helpstring("Sets the last error number to dwErrCode"),
    ]
    VOID WINAPI SetLastError([in] DWORD dwErrCode);

    [
    usesgetlasterror,
    entry("GetComputerNameA"),
    helpstring("Gets the computer (machine) name"),
    ]
    BOOL WINAPI GetComputerName([in, out] LPSTR lpBuffer,
                                [in, out] DWORD FAR * nSize);

    [
    usesgetlasterror,
    entry("SetComputerNameA"),
    helpstring("Sets the computer (machine) name"),
    ]
    BOOL WINAPI SetComputerName([in] LPCSTR lpComputerName);

    [
    usesgetlasterror,
    entry("GetVolumeInformationA"),
    helpstring("Gets information about a disk including volume name, serial number, maximum component length, and file system name"),
    ]
    BOOL WINAPI GetVolumeInformation([in] LPCSTR lpRootPathName,
                                     [in, out] LPSTR lpVolumeNameBuffer,
                                     [in] DWORD nVolumeNameSize,
                                     [in, out] DWORD FAR *lpVolumeSerialNumber,
                                     [in, out] DWORD FAR *lpMaximumComponentLength,
                                     [in, out] DWORD FAR *lpFileSystemFlags,
                                     [in, out] LPSTR lpFileSystemNameBuffer,
                                     [in] DWORD nFileSystemNameSize);

    [
    entry("FlushFileBuffers"),
    helpstring("Writes file buffers for an open handle to disk"),
    ]
    BOOL WINAPI FlushFileBuffers([in] HANDLE hFile);

    [
    entry("Beep"),
    helpstring("Plays a sound of given frequency and duration"),
    ]
    BOOL WINAPI Beep([in] DWORD dwFreq, [in] DWORD dwDuration);

    /* To be implemented
    BOOL WINAPI FreeEnvironmentStringsA(
        LPSTR
        );

    DWORD WINAPI ExpandEnvironmentStringsA(
        LPCSTR lpSrc,
        LPSTR lpDst,
        DWORD nSize
        );

    */

    [
    entry("SetVolumeLabelA"),
    helpstring("Sets label of file system volume specified by root path"),
    ]
    BOOL WINAPI SetVolumeLabel([in] LPCSTR lpRootPathName,
                               [in] LPCSTR lpVolumeName);

    [
    entry("Sleep"),
    helpstring("Suspends execution of the current thread for a specified interval"),
    ]
    VOID WINAPI Sleep([in] DWORD dwMilliseconds);


    /* Find file not implemented
    HANDLE WINAPI FindFirstFileA(
        LPCSTR lpFileName,
        LPWIN32_FIND_DATAA lpFindFileData
        );

    BOOL WINAPI FindNextFileA(
        HANDLE hFindFile,
        LPWIN32_FIND_DATAA lpFindFileData
        );

    BOOL WINAPI FindClose(HANDLE hFindFile);

    typedef struct _WIN32_FIND_DATAA {
        DWORD dwFileAttributes;
        FILETIME ftCreationTime;
        FILETIME ftLastAccessTime;
        FILETIME ftLastWriteTime;
        DWORD nFileSizeHigh;
        DWORD nFileSizeLow;
        DWORD dwReserved0;
        DWORD dwReserved1;
        CHAR   cFileName[ MAX_PATH ];
        CHAR   cAlternateFileName[ 14 ];
    } WIN32_FIND_DATAA, *PWIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
    */

    /* Interlocked not implemented
    LONG WINAPI InterlockedIncrement(
        LPLONG lpAddend
        );

    LONG WINAPI InterlockedDecrement(
        LPLONG lpAddend
        );

    LONG WINAPI InterlockedExchange(
        LPLONG Target,
        LONG Value
        );
    */

    /* Can't implement GlobalMemoryStatus
    VOID WINAPI GlobalMemoryStatus(
        LPMEMORYSTATUS lpBuffer
        );
    */

    /* Instruction cache not implemented
    BOOL WINAPI FlushInstructionCache(
        HANDLE hProcess,
        LPCVOID lpBaseAddress,
        DWORD dwSize
        );
    */

    /*
    typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(
        struct _EXCEPTION_POINTERS *ExceptionInfo
        );
    typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
    */

    /* Threads not implemented
    HANDLE WINAPI CreateThread(
        LPSECURITY_ATTRIBUTES lpThreadAttributes,
        DWORD dwStackSize,
        LPTHREAD_START_ROUTINE lpStartAddress,
        LPVOID lpParameter,
        DWORD dwCreationFlags,
        LPDWORD lpThreadId
        );

    HANDLE WINAPI CreateRemoteThread(
        HANDLE hProcess,
        LPSECURITY_ATTRIBUTES lpThreadAttributes,
        DWORD dwStackSize,
        LPTHREAD_START_ROUTINE lpStartAddress,
        LPVOID lpParameter,
        DWORD dwCreationFlags,
        LPDWORD lpThreadId
        );

    HANDLE WINAPI GetCurrentThread(
        VOID
        );

    DWORD WINAPI GetCurrentThreadId(
        VOID
        );

    DWORD WINAPI SetThreadAffinityMask(
        HANDLE hThread,
        DWORD dwThreadAffinityMask
        );

    BOOL WINAPI SetThreadPriority(
        HANDLE hThread,
        int nPriority
        );

    int WINAPI GetThreadPriority(
        HANDLE hThread
        );

    BOOL WINAPI GetThreadTimes(
        HANDLE hThread,
        LPFILETIME lpCreationTime,
        LPFILETIME lpExitTime,
        LPFILETIME lpKernelTime,
        LPFILETIME lpUserTime
        );

    VOID WINAPI ExitThread(
        DWORD dwExitCode
        );

    BOOL WINAPI TerminateThread(
        HANDLE hThread,
        DWORD dwExitCode
        );

    BOOL WINAPI GetExitCodeThread(
        HANDLE hThread,
        LPDWORD lpExitCode
        );

    BOOL WINAPI GetThreadSelectorEntry(
        HANDLE hThread,
        DWORD dwSelector,
        LPLDT_ENTRY lpSelectorEntry
        );
    */

    /* Completion not implemented
    BOOL WINAPI GetOverlappedResult(
        HANDLE hFile,
        LPOVERLAPPED lpOverlapped,
        LPDWORD lpNumberOfBytesTransferred,
        BOOL bWait
        );

    HANDLE WINAPI CreateIoCompletionPort(
        HANDLE FileHandle,
        HANDLE ExistingCompletionPort,
        DWORD CompletionKey,
        DWORD NumberOfConcurrentThreads
        );

    BOOL WINAPI GetQueuedCompletionStatus(
        HANDLE CompletionPort,
        LPDWORD lpNumberOfBytesTransferred,
        LPDWORD lpCompletionKey,
        LPOVERLAPPED *lpOverlapped,
        DWORD dwMilliseconds
        );
    */

    /* Debugger support not implemented
    BOOL WINAPI ReadProcessMemory(
        HANDLE hProcess,
        LPCVOID lpBaseAddress,
        LPVOID lpBuffer,
        DWORD nSize,
        LPDWORD lpNumberOfBytesRead
        );

    BOOL WINAPI WriteProcessMemory(
        HANDLE hProcess,
        LPVOID lpBaseAddress,
        LPVOID lpBuffer,
        DWORD nSize,
        LPDWORD lpNumberOfBytesWritten
        );

    BOOL WINAPI GetThreadContext(
        HANDLE hThread,
        LPCONTEXT lpContext
        );

    BOOL WINAPI SetThreadContext(
        HANDLE hThread,
        CONST CONTEXT *lpContext
        );

    DWORD WINAPI SuspendThread(
        HANDLE hThread
        );

    DWORD WINAPI ResumeThread(
        HANDLE hThread
        );

    BOOL WINAPI WaitForDebugEvent(
        LPDEBUG_EVENT lpDebugEvent,
        DWORD dwMilliseconds
        );

    BOOL WINAPI ContinueDebugEvent(
        DWORD dwProcessId,
        DWORD dwThreadId,
        DWORD dwContinueStatus
        );

    BOOL WINAPI DebugActiveProcess(
        DWORD dwProcessId
        );
    */

    /* Critical sections not implemented
    VOID WINAPI InitializeCriticalSection(
        LPCRITICAL_SECTION lpCriticalSection
        );

    VOID WINAPI EnterCriticalSection(
        LPCRITICAL_SECTION lpCriticalSection
        );

    VOID WINAPI LeaveCriticalSection(
        LPCRITICAL_SECTION lpCriticalSection
        );

    VOID WINAPI DeleteCriticalSection(
        LPCRITICAL_SECTION lpCriticalSection
        );
    */

    /* Interprocess communication not implemented
    BOOL WINAPI SetEvent(
        HANDLE hEvent
        );

    BOOL WINAPI ResetEvent(
        HANDLE hEvent
        );

    BOOL WINAPI PulseEvent(
        HANDLE hEvent
        );

    BOOL WINAPI ReleaseSemaphore(
        HANDLE hSemaphore,
        LONG lReleaseCount,
        LPLONG lpPreviousCount
        );

    BOOL WINAPI ReleaseMutex(
        HANDLE hMutex
        );
    */

    [
    usesgetlasterror,
    entry("WaitForSingleObject"),
    helpstring("Waits until the specified object reaches the signaled state, or until the time-out elapses"),
    ]
    DWORD WINAPI WaitForSingleObject(
        [in] HANDLE hHandle,
        [in] DWORD dwMilliseconds
        );

    [
    usesgetlasterror,
    entry("WaitForMultipleObjects"),
    helpstring("Waits until any one or all of the specified objects reaches the signaled state, or until the time-out elapses"),
    ]
    DWORD WINAPI WaitForMultipleObjects(
        [in] DWORD nCount,
        [in, out] HANDLE *lpHandles,
        [in] BOOL bWaitAll,
        [in] DWORD dwMilliseconds
        );

    /*
    typedef
    VOID
    (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)(
        DWORD dwErrorCode,
        DWORD dwNumberOfBytesTransfered,
        LPOVERLAPPED lpOverlapped
        );

    DWORD WINAPI SleepEx(
        DWORD dwMilliseconds,
        BOOL bAlertable
        );

    DWORD WINAPI WaitForSingleObjectEx(
        HANDLE hHandle,
        DWORD dwMilliseconds,
        BOOL bAlertable
        );

    DWORD WINAPI WaitForMultipleObjectsEx(
        DWORD nCount,
        CONST HANDLE *lpHandles,
        BOOL bWaitAll,
        DWORD dwMilliseconds,
        BOOL bAlertable
        );

    HANDLE WINAPI CreateMutexA(
        LPSECURITY_ATTRIBUTES lpMutexAttributes,
        BOOL bInitialOwner,
        LPCSTR lpName
        );

    HANDLE WINAPI OpenMutexA(
        DWORD dwDesiredAccess,
        BOOL bInheritHandle,
        LPCSTR lpName
        );

    HANDLE WINAPI CreateEventA(
        LPSECURITY_ATTRIBUTES lpEventAttributes,
        BOOL bManualReset,
        BOOL bInitialState,
        LPCSTR lpName
        );

    HANDLE WINAPI OpenEventA(
        DWORD dwDesiredAccess,
        BOOL bInheritHandle,
        LPCSTR lpName
        );

    HANDLE WINAPI CreateSemaphoreA(
        LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
        LONG lInitialCount,
        LONG lMaximumCount,
        LPCSTR lpName
        );

    HANDLE WINAPI OpenSemaphoreA(
        DWORD dwDesiredAccess,
        BOOL bInheritHandle,
        LPCSTR lpName
        );

    */

    /* Tape and backup not implemented
    DWORD WINAPI SetTapePosition(
        HANDLE hDevice,
        DWORD dwPositionMethod,
        DWORD dwPartition,
        DWORD dwOffsetLow,
        DWORD dwOffsetHigh,
        BOOL bImmediate
        );

    DWORD WINAPI GetTapePosition(
        HANDLE hDevice,

⌨️ 快捷键说明

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