From 319353fed882d1335e9579feaa14c1040c946869 Mon Sep 17 00:00:00 2001 From: erg Date: Tue, 1 Aug 2006 22:59:56 +0000 Subject: [PATCH] win32 directory restructuring --- library/bootstrap/boot-stage2.factor | 1 + library/ui/windows/load.factor | 2 +- library/windows/gdi32.factor | 4 +- library/windows/kernel32-constants.factor | 10 + library/windows/kernel32-full.factor | 949 ------------------- library/windows/kernel32.factor | 1012 +++++++++++++++++++-- library/windows/load.factor | 61 +- library/windows/types.factor | 5 +- library/windows/user32.factor | 486 ++++++++++ library/windows/utils.factor | 8 +- library/windows/windows-messages.factor | 8 +- 11 files changed, 1502 insertions(+), 1044 deletions(-) delete mode 100644 library/windows/kernel32-full.factor diff --git a/library/bootstrap/boot-stage2.factor b/library/bootstrap/boot-stage2.factor index 2ce6016f3e..24487fb1ba 100644 --- a/library/bootstrap/boot-stage2.factor +++ b/library/bootstrap/boot-stage2.factor @@ -19,6 +19,7 @@ parser sequences sequences-internals words ; "compile" get [ windows? [ + "/library/windows/load.factor" run-resource "/library/ui/windows/load.factor" run-resource ] when diff --git a/library/ui/windows/load.factor b/library/ui/windows/load.factor index d35c8ac6ba..c4360931cd 100644 --- a/library/ui/windows/load.factor +++ b/library/ui/windows/load.factor @@ -2,8 +2,8 @@ IN: scratchpad USING: alien kernel namespaces parser sequences words ; { - "ui" "clipboard" + "ui" } [ "/library/ui/windows/" swap ".factor" append3 run-resource ] each IN: kernel diff --git a/library/windows/gdi32.factor b/library/windows/gdi32.factor index 2f915cf1df..1f737b9eaf 100644 --- a/library/windows/gdi32.factor +++ b/library/windows/gdi32.factor @@ -329,7 +329,7 @@ FUNCTION: int ChoosePixelFormat ( HDC hDC, PFD* ppfd ) ; ! FUNCTION: GdiSetAttrs ! FUNCTION: GdiSetBatchLimit ! FUNCTION: GdiSetLastError -FUNCTION: BOOL GdiSetPixelFormat ( HDC hDC, int iPixelFormat, PFD* ppfd ) ; +! FUNCTION: GdiSetPixelFormat ! FUNCTION: GdiSetServerAttr ! FUNCTION: GdiStartDocEMF ! FUNCTION: GdiStartPageEMF @@ -566,7 +566,7 @@ FUNCTION: HGDIOBJ GetStockObject ( int fnObject ) ; ! FUNCTION: SetMiterLimit ! FUNCTION: SetPaletteEntries ! FUNCTION: SetPixel -! FUNCTION: SetPixelFormat +FUNCTION: BOOL SetPixelFormat ( HDC hDC, int iPixelFormat, PFD* ppfd ) ; ! FUNCTION: SetPixelV ! FUNCTION: SetPolyFillMode ! FUNCTION: SetRectRgn diff --git a/library/windows/kernel32-constants.factor b/library/windows/kernel32-constants.factor index b177dc7c32..5d3550a78a 100644 --- a/library/windows/kernel32-constants.factor +++ b/library/windows/kernel32-constants.factor @@ -1 +1,11 @@ IN: win32-api +USING: alien kernel errors ; + + +: GHND HEX: 40 ; inline +: GMEM_FIXED 0 ; inline +: GMEM_MOVEABLE 2 ; inline +: GMEM_ZEROINIT HEX: 40 ; inline +: GPTR HEX: 40 ; inline + + diff --git a/library/windows/kernel32-full.factor b/library/windows/kernel32-full.factor deleted file mode 100644 index d15472a9f6..0000000000 --- a/library/windows/kernel32-full.factor +++ /dev/null @@ -1,949 +0,0 @@ -! FUNCTION: _hread -! FUNCTION: _hwrite -! FUNCTION: _lclose -! FUNCTION: _lcreat -! FUNCTION: _llseek -! FUNCTION: _lopen -! FUNCTION: _lread -! FUNCTION: _lwrite -! FUNCTION: ActivateActCtx -! FUNCTION: AddAtomA -! FUNCTION: AddAtomW -! FUNCTION: AddConsoleAliasA -! FUNCTION: AddConsoleAliasW -! FUNCTION: AddLocalAlternateComputerNameA -! FUNCTION: AddLocalAlternateComputerNameW -! FUNCTION: AddRefActCtx -! FUNCTION: AddVectoredExceptionHandler -! FUNCTION: AllocateUserPhysicalPages -! FUNCTION: AllocConsole -! FUNCTION: AreFileApisANSI -! FUNCTION: AssignProcessToJobObject -! FUNCTION: AttachConsole -! FUNCTION: BackupRead -! FUNCTION: BackupSeek -! FUNCTION: BackupWrite -! FUNCTION: BaseCheckAppcompatCache -! FUNCTION: BaseCleanupAppcompatCache -! FUNCTION: BaseCleanupAppcompatCacheSupport -! FUNCTION: BaseDumpAppcompatCache -! FUNCTION: BaseFlushAppcompatCache -! FUNCTION: BaseInitAppcompatCache -! FUNCTION: BaseInitAppcompatCacheSupport -! FUNCTION: BasepCheckWinSaferRestrictions -! FUNCTION: BaseProcessInitPostImport -! FUNCTION: BaseQueryModuleData -! FUNCTION: BaseUpdateAppcompatCache -! FUNCTION: Beep -! FUNCTION: BeginUpdateResourceA -! FUNCTION: BeginUpdateResourceW -! FUNCTION: BindIoCompletionCallback -! FUNCTION: BuildCommDCBA -! FUNCTION: BuildCommDCBAndTimeoutsA -! FUNCTION: BuildCommDCBAndTimeoutsW -! FUNCTION: BuildCommDCBW -! FUNCTION: CallNamedPipeA -! FUNCTION: CallNamedPipeW -! FUNCTION: CancelDeviceWakeupRequest -! FUNCTION: CancelIo -! FUNCTION: CancelTimerQueueTimer -! FUNCTION: CancelWaitableTimer -! FUNCTION: ChangeTimerQueueTimer -! FUNCTION: CheckNameLegalDOS8Dot3A -! FUNCTION: CheckNameLegalDOS8Dot3W -! FUNCTION: CheckRemoteDebuggerPresent -! FUNCTION: ClearCommBreak -! FUNCTION: ClearCommError -! FUNCTION: CloseConsoleHandle -! FUNCTION: CloseHandle -! FUNCTION: CloseProfileUserMapping -! FUNCTION: CmdBatNotification -! FUNCTION: CommConfigDialogA -! FUNCTION: CommConfigDialogW -! FUNCTION: CompareFileTime -! FUNCTION: CompareStringA -! FUNCTION: CompareStringW -! FUNCTION: ConnectNamedPipe -! FUNCTION: ConsoleMenuControl -! FUNCTION: ContinueDebugEvent -! FUNCTION: ConvertDefaultLocale -! FUNCTION: ConvertFiberToThread -! FUNCTION: ConvertThreadToFiber -! FUNCTION: CopyFileA -! FUNCTION: CopyFileExA -! FUNCTION: CopyFileExW -! FUNCTION: CopyFileW -! FUNCTION: CopyLZFile -! FUNCTION: CreateActCtxA -! FUNCTION: CreateActCtxW -! FUNCTION: CreateConsoleScreenBuffer -! FUNCTION: CreateDirectoryA -! FUNCTION: CreateDirectoryExA -! FUNCTION: CreateDirectoryExW -! FUNCTION: CreateDirectoryW -! FUNCTION: CreateEventA -! FUNCTION: CreateEventW -! FUNCTION: CreateFiber -! FUNCTION: CreateFiberEx -! FUNCTION: CreateFileA -! FUNCTION: CreateFileMappingA -! FUNCTION: CreateFileMappingW -! FUNCTION: CreateFileW -! FUNCTION: CreateHardLinkA -! FUNCTION: CreateHardLinkW -! FUNCTION: CreateIoCompletionPort -! FUNCTION: CreateJobObjectA -! FUNCTION: CreateJobObjectW -! FUNCTION: CreateJobSet -! FUNCTION: CreateMailslotA -! FUNCTION: CreateMailslotW -! FUNCTION: CreateMemoryResourceNotification -! FUNCTION: CreateMutexA -! FUNCTION: CreateMutexW -! FUNCTION: CreateNamedPipeA -! FUNCTION: CreateNamedPipeW -! FUNCTION: CreateNlsSecurityDescriptor -! FUNCTION: CreatePipe -! FUNCTION: CreateProcessA -! FUNCTION: CreateProcessInternalA -! FUNCTION: CreateProcessInternalW -! FUNCTION: CreateProcessInternalWSecure -! FUNCTION: CreateProcessW -! FUNCTION: CreateRemoteThread -! FUNCTION: CreateSemaphoreA -! FUNCTION: CreateSemaphoreW -! FUNCTION: CreateSocketHandle -! FUNCTION: CreateTapePartition -! FUNCTION: CreateThread -! FUNCTION: CreateTimerQueue -! FUNCTION: CreateTimerQueueTimer -! FUNCTION: CreateToolhelp32Snapshot -! FUNCTION: CreateVirtualBuffer -! FUNCTION: CreateWaitableTimerA -! FUNCTION: CreateWaitableTimerW -! FUNCTION: DeactivateActCtx -! FUNCTION: DebugActiveProcess -! FUNCTION: DebugActiveProcessStop -! FUNCTION: DebugBreak -! FUNCTION: DebugBreakProcess -! FUNCTION: DebugSetProcessKillOnExit -! FUNCTION: DecodePointer -! FUNCTION: DecodeSystemPointer -! FUNCTION: DefineDosDeviceA -! FUNCTION: DefineDosDeviceW -! FUNCTION: DelayLoadFailureHook -! FUNCTION: DeleteAtom -! FUNCTION: DeleteCriticalSection -! FUNCTION: DeleteFiber -! FUNCTION: DeleteFileA -! FUNCTION: DeleteFileW -! FUNCTION: DeleteTimerQueue -! FUNCTION: DeleteTimerQueueEx -! FUNCTION: DeleteTimerQueueTimer -! FUNCTION: DeleteVolumeMountPointA -! FUNCTION: DeleteVolumeMountPointW -! FUNCTION: DeviceIoControl -! FUNCTION: DisableThreadLibraryCalls -! FUNCTION: DisconnectNamedPipe -! FUNCTION: DnsHostnameToComputerNameA -! FUNCTION: DnsHostnameToComputerNameW -! FUNCTION: DosDateTimeToFileTime -! FUNCTION: DosPathToSessionPathA -! FUNCTION: DosPathToSessionPathW -! FUNCTION: DuplicateConsoleHandle -! FUNCTION: DuplicateHandle -! FUNCTION: EncodePointer -! FUNCTION: EncodeSystemPointer -! FUNCTION: EndUpdateResourceA -! FUNCTION: EndUpdateResourceW -! FUNCTION: EnterCriticalSection -! FUNCTION: EnumCalendarInfoA -! FUNCTION: EnumCalendarInfoExA -! FUNCTION: EnumCalendarInfoExW -! FUNCTION: EnumCalendarInfoW -! FUNCTION: EnumDateFormatsA -! FUNCTION: EnumDateFormatsExA -! FUNCTION: EnumDateFormatsExW -! FUNCTION: EnumDateFormatsW -! FUNCTION: EnumerateLocalComputerNamesA -! FUNCTION: EnumerateLocalComputerNamesW -! FUNCTION: EnumLanguageGroupLocalesA -! FUNCTION: EnumLanguageGroupLocalesW -! FUNCTION: EnumResourceLanguagesA -! FUNCTION: EnumResourceLanguagesW -! FUNCTION: EnumResourceNamesA -! FUNCTION: EnumResourceNamesW -! FUNCTION: EnumResourceTypesA -! FUNCTION: EnumResourceTypesW -! FUNCTION: EnumSystemCodePagesA -! FUNCTION: EnumSystemCodePagesW -! FUNCTION: EnumSystemGeoID -! FUNCTION: EnumSystemLanguageGroupsA -! FUNCTION: EnumSystemLanguageGroupsW -! FUNCTION: EnumSystemLocalesA -! FUNCTION: EnumSystemLocalesW -! FUNCTION: EnumTimeFormatsA -! FUNCTION: EnumTimeFormatsW -! FUNCTION: EnumUILanguagesA -! FUNCTION: EnumUILanguagesW -! FUNCTION: EraseTape -! FUNCTION: EscapeCommFunction -! FUNCTION: ExitProcess -! FUNCTION: ExitThread -! FUNCTION: ExitVDM -! FUNCTION: ExpandEnvironmentStringsA -! FUNCTION: ExpandEnvironmentStringsW -! FUNCTION: ExpungeConsoleCommandHistoryA -! FUNCTION: ExpungeConsoleCommandHistoryW -! FUNCTION: ExtendVirtualBuffer -! FUNCTION: FatalAppExitA -! FUNCTION: FatalAppExitW -! FUNCTION: FatalExit -! FUNCTION: FileTimeToDosDateTime -! FUNCTION: FileTimeToLocalFileTime -! FUNCTION: FileTimeToSystemTime -! FUNCTION: FillConsoleOutputAttribute -! FUNCTION: FillConsoleOutputCharacterA -! FUNCTION: FillConsoleOutputCharacterW -! FUNCTION: FindActCtxSectionGuid -! FUNCTION: FindActCtxSectionStringA -! FUNCTION: FindActCtxSectionStringW -! FUNCTION: FindAtomA -! FUNCTION: FindAtomW -! FUNCTION: FindClose -! FUNCTION: FindCloseChangeNotification -! FUNCTION: FindFirstChangeNotificationA -! FUNCTION: FindFirstChangeNotificationW -! FUNCTION: FindFirstFileA -! FUNCTION: FindFirstFileExA -! FUNCTION: FindFirstFileExW -! FUNCTION: FindFirstFileW -! FUNCTION: FindFirstVolumeA -! FUNCTION: FindFirstVolumeMountPointA -! FUNCTION: FindFirstVolumeMountPointW -! FUNCTION: FindFirstVolumeW -! FUNCTION: FindNextChangeNotification -! FUNCTION: FindNextFileA -! FUNCTION: FindNextFileW -! FUNCTION: FindNextVolumeA -! FUNCTION: FindNextVolumeMountPointA -! FUNCTION: FindNextVolumeMountPointW -! FUNCTION: FindNextVolumeW -! FUNCTION: FindResourceA -! FUNCTION: FindResourceExA -! FUNCTION: FindResourceExW -! FUNCTION: FindResourceW -! FUNCTION: FindVolumeClose -! FUNCTION: FindVolumeMountPointClose -! FUNCTION: FlushConsoleInputBuffer -! FUNCTION: FlushFileBuffers -! FUNCTION: FlushInstructionCache -! FUNCTION: FlushViewOfFile -! FUNCTION: FoldStringA -! FUNCTION: FoldStringW -! FUNCTION: FormatMessageA -! FUNCTION: FormatMessageW -! FUNCTION: FreeConsole -! FUNCTION: FreeEnvironmentStringsA -! FUNCTION: FreeEnvironmentStringsW -! FUNCTION: FreeLibrary -! FUNCTION: FreeLibraryAndExitThread -! FUNCTION: FreeResource -! FUNCTION: FreeUserPhysicalPages -! FUNCTION: FreeVirtualBuffer -! FUNCTION: GenerateConsoleCtrlEvent -! FUNCTION: GetACP -! FUNCTION: GetAtomNameA -! FUNCTION: GetAtomNameW -! FUNCTION: GetBinaryType -! FUNCTION: GetBinaryTypeA -! FUNCTION: GetBinaryTypeW -! FUNCTION: GetCalendarInfoA -! FUNCTION: GetCalendarInfoW -! FUNCTION: GetCommandLineA -! FUNCTION: GetCommandLineW -! FUNCTION: GetCommConfig -! FUNCTION: GetCommMask -! FUNCTION: GetCommModemStatus -! FUNCTION: GetCommProperties -! FUNCTION: GetCommState -! FUNCTION: GetCommTimeouts -! FUNCTION: GetComPlusPackageInstallStatus -! FUNCTION: GetCompressedFileSizeA -! FUNCTION: GetCompressedFileSizeW -! FUNCTION: GetComputerNameA -! FUNCTION: GetComputerNameExA -! FUNCTION: GetComputerNameExW -! FUNCTION: GetComputerNameW -! FUNCTION: GetConsoleAliasA -! FUNCTION: GetConsoleAliasesA -! FUNCTION: GetConsoleAliasesLengthA -! FUNCTION: GetConsoleAliasesLengthW -! FUNCTION: GetConsoleAliasesW -! FUNCTION: GetConsoleAliasExesA -! FUNCTION: GetConsoleAliasExesLengthA -! FUNCTION: GetConsoleAliasExesLengthW -! FUNCTION: GetConsoleAliasExesW -! FUNCTION: GetConsoleAliasW -! FUNCTION: GetConsoleCharType -! FUNCTION: GetConsoleCommandHistoryA -! FUNCTION: GetConsoleCommandHistoryLengthA -! FUNCTION: GetConsoleCommandHistoryLengthW -! FUNCTION: GetConsoleCommandHistoryW -! FUNCTION: GetConsoleCP -! FUNCTION: GetConsoleCursorInfo -! FUNCTION: GetConsoleCursorMode -! FUNCTION: GetConsoleDisplayMode -! FUNCTION: GetConsoleFontInfo -! FUNCTION: GetConsoleFontSize -! FUNCTION: GetConsoleHardwareState -! FUNCTION: GetConsoleInputExeNameA -! FUNCTION: GetConsoleInputExeNameW -! FUNCTION: GetConsoleInputWaitHandle -! FUNCTION: GetConsoleKeyboardLayoutNameA -! FUNCTION: GetConsoleKeyboardLayoutNameW -! FUNCTION: GetConsoleMode -! FUNCTION: GetConsoleNlsMode -! FUNCTION: GetConsoleOutputCP -! FUNCTION: GetConsoleProcessList -! FUNCTION: GetConsoleScreenBufferInfo -! FUNCTION: GetConsoleSelectionInfo -! FUNCTION: GetConsoleTitleA -! FUNCTION: GetConsoleTitleW -! FUNCTION: GetConsoleWindow -! FUNCTION: GetCPFileNameFromRegistry -! FUNCTION: GetCPInfo -! FUNCTION: GetCPInfoExA -! FUNCTION: GetCPInfoExW -! FUNCTION: GetCurrencyFormatA -! FUNCTION: GetCurrencyFormatW -! FUNCTION: GetCurrentActCtx -! FUNCTION: GetCurrentConsoleFont -! FUNCTION: GetCurrentDirectoryA -! FUNCTION: GetCurrentDirectoryW -! FUNCTION: GetCurrentProcess -! FUNCTION: GetCurrentProcessId -! FUNCTION: GetCurrentThread -! FUNCTION: GetCurrentThreadId -! FUNCTION: GetDateFormatA -! FUNCTION: GetDateFormatW -! FUNCTION: GetDefaultCommConfigA -! FUNCTION: GetDefaultCommConfigW -! FUNCTION: GetDefaultSortkeySize -! FUNCTION: GetDevicePowerState -! FUNCTION: GetDiskFreeSpaceA -! FUNCTION: GetDiskFreeSpaceExA -! FUNCTION: GetDiskFreeSpaceExW -! FUNCTION: GetDiskFreeSpaceW -! FUNCTION: GetDllDirectoryA -! FUNCTION: GetDllDirectoryW -! FUNCTION: GetDriveTypeA -! FUNCTION: GetDriveTypeW -! FUNCTION: GetEnvironmentStrings -! FUNCTION: GetEnvironmentStringsA -! FUNCTION: GetEnvironmentStringsW -! FUNCTION: GetEnvironmentVariableA -! FUNCTION: GetEnvironmentVariableW -! FUNCTION: GetExitCodeProcess -! FUNCTION: GetExitCodeThread -! FUNCTION: GetExpandedNameA -! FUNCTION: GetExpandedNameW -! FUNCTION: GetFileAttributesA -! FUNCTION: GetFileAttributesExA -! FUNCTION: GetFileAttributesExW -! FUNCTION: GetFileAttributesW -! FUNCTION: GetFileInformationByHandle -! FUNCTION: GetFileSize -! FUNCTION: GetFileSizeEx -! FUNCTION: GetFileTime -! FUNCTION: GetFileType -! FUNCTION: GetFirmwareEnvironmentVariableA -! FUNCTION: GetFirmwareEnvironmentVariableW -! FUNCTION: GetFullPathNameA -! FUNCTION: GetFullPathNameW -! FUNCTION: GetGeoInfoA -! FUNCTION: GetGeoInfoW -! FUNCTION: GetHandleContext -! FUNCTION: GetHandleInformation -! FUNCTION: GetLargestConsoleWindowSize -! FUNCTION: GetLastError -! FUNCTION: GetLinguistLangSize -! FUNCTION: GetLocaleInfoA -! FUNCTION: GetLocaleInfoW -! FUNCTION: GetLocalTime -! FUNCTION: GetLogicalDrives -! FUNCTION: GetLogicalDriveStringsA -! FUNCTION: GetLogicalDriveStringsW -! FUNCTION: GetLongPathNameA -! FUNCTION: GetLongPathNameW -! FUNCTION: GetMailslotInfo -! FUNCTION: GetModuleFileNameA -! FUNCTION: GetModuleFileNameW -! FUNCTION: GetModuleHandleA -! FUNCTION: GetModuleHandleExA -! FUNCTION: GetModuleHandleExW -! FUNCTION: GetModuleHandleW -! FUNCTION: GetNamedPipeHandleStateA -! FUNCTION: GetNamedPipeHandleStateW -! FUNCTION: GetNamedPipeInfo -! FUNCTION: GetNativeSystemInfo -! FUNCTION: GetNextVDMCommand -! FUNCTION: GetNlsSectionName -! FUNCTION: GetNumaAvailableMemory -! FUNCTION: GetNumaAvailableMemoryNode -! FUNCTION: GetNumaHighestNodeNumber -! FUNCTION: GetNumaNodeProcessorMask -! FUNCTION: GetNumaProcessorMap -! FUNCTION: GetNumaProcessorNode -! FUNCTION: GetNumberFormatA -! FUNCTION: GetNumberFormatW -! FUNCTION: GetNumberOfConsoleFonts -! FUNCTION: GetNumberOfConsoleInputEvents -! FUNCTION: GetNumberOfConsoleMouseButtons -! FUNCTION: GetOEMCP -! FUNCTION: GetOverlappedResult -! FUNCTION: GetPriorityClass -! FUNCTION: GetPrivateProfileIntA -! FUNCTION: GetPrivateProfileIntW -! FUNCTION: GetPrivateProfileSectionA -! FUNCTION: GetPrivateProfileSectionNamesA -! FUNCTION: GetPrivateProfileSectionNamesW -! FUNCTION: GetPrivateProfileSectionW -! FUNCTION: GetPrivateProfileStringA -! FUNCTION: GetPrivateProfileStringW -! FUNCTION: GetPrivateProfileStructA -! FUNCTION: GetPrivateProfileStructW -! FUNCTION: GetProcAddress -! FUNCTION: GetProcessAffinityMask -! FUNCTION: GetProcessHandleCount -! FUNCTION: GetProcessHeap -! FUNCTION: GetProcessHeaps -! FUNCTION: GetProcessId -! FUNCTION: GetProcessIoCounters -! FUNCTION: GetProcessPriorityBoost -! FUNCTION: GetProcessShutdownParameters -! FUNCTION: GetProcessTimes -! FUNCTION: GetProcessVersion -! FUNCTION: GetProcessWorkingSetSize -! FUNCTION: GetProfileIntA -! FUNCTION: GetProfileIntW -! FUNCTION: GetProfileSectionA -! FUNCTION: GetProfileSectionW -! FUNCTION: GetProfileStringA -! FUNCTION: GetProfileStringW -! FUNCTION: GetQueuedCompletionStatus -! FUNCTION: GetShortPathNameA -! FUNCTION: GetShortPathNameW -! FUNCTION: GetStartupInfoA -! FUNCTION: GetStartupInfoW -! FUNCTION: GetStdHandle -! FUNCTION: GetStringTypeA -! FUNCTION: GetStringTypeExA -! FUNCTION: GetStringTypeExW -! FUNCTION: GetStringTypeW -! FUNCTION: GetSystemDefaultLangID -! FUNCTION: GetSystemDefaultLCID -! FUNCTION: GetSystemDefaultUILanguage -! FUNCTION: GetSystemDirectoryA -! FUNCTION: GetSystemDirectoryW -! FUNCTION: GetSystemInfo -! FUNCTION: GetSystemPowerStatus -! FUNCTION: GetSystemRegistryQuota -! FUNCTION: GetSystemTime -! FUNCTION: GetSystemTimeAdjustment -! FUNCTION: GetSystemTimeAsFileTime -! FUNCTION: GetSystemTimes -! FUNCTION: GetSystemWindowsDirectoryA -! FUNCTION: GetSystemWindowsDirectoryW -! FUNCTION: GetSystemWow64DirectoryA -! FUNCTION: GetSystemWow64DirectoryW -! FUNCTION: GetTapeParameters -! FUNCTION: GetTapePosition -! FUNCTION: GetTapeStatus -! FUNCTION: GetTempFileNameA -! FUNCTION: GetTempFileNameW -! FUNCTION: GetTempPathA -! FUNCTION: GetTempPathW -! FUNCTION: GetThreadContext -! FUNCTION: GetThreadIOPendingFlag -! FUNCTION: GetThreadLocale -! FUNCTION: GetThreadPriority -! FUNCTION: GetThreadPriorityBoost -! FUNCTION: GetThreadSelectorEntry -! FUNCTION: GetThreadTimes -! FUNCTION: GetTickCount -! FUNCTION: GetTimeFormatA -! FUNCTION: GetTimeFormatW -! FUNCTION: GetTimeZoneInformation -! FUNCTION: GetUserDefaultLangID -! FUNCTION: GetUserDefaultLCID -! FUNCTION: GetUserDefaultUILanguage -! FUNCTION: GetUserGeoID -! FUNCTION: GetVDMCurrentDirectories -! FUNCTION: GetVersion -! FUNCTION: GetVersionExA -! FUNCTION: GetVersionExW -! FUNCTION: GetVolumeInformationA -! FUNCTION: GetVolumeInformationW -! FUNCTION: GetVolumeNameForVolumeMountPointA -! FUNCTION: GetVolumeNameForVolumeMountPointW -! FUNCTION: GetVolumePathNameA -! FUNCTION: GetVolumePathNamesForVolumeNameA -! FUNCTION: GetVolumePathNamesForVolumeNameW -! FUNCTION: GetVolumePathNameW -! FUNCTION: GetWindowsDirectoryA -! FUNCTION: GetWindowsDirectoryW -! FUNCTION: GetWriteWatch -! FUNCTION: GlobalAddAtomA -! FUNCTION: GlobalAddAtomW -! FUNCTION: GlobalAlloc -! FUNCTION: GlobalCompact -! FUNCTION: GlobalDeleteAtom -! FUNCTION: GlobalFindAtomA -! FUNCTION: GlobalFindAtomW -! FUNCTION: GlobalFix -! FUNCTION: GlobalFlags -! FUNCTION: GlobalFree -! FUNCTION: GlobalGetAtomNameA -! FUNCTION: GlobalGetAtomNameW -! FUNCTION: GlobalHandle -! FUNCTION: GlobalLock -! FUNCTION: GlobalMemoryStatus -! FUNCTION: GlobalMemoryStatusEx -! FUNCTION: GlobalReAlloc -! FUNCTION: GlobalSize -! FUNCTION: GlobalUnfix -! FUNCTION: GlobalUnlock -! FUNCTION: GlobalUnWire -! FUNCTION: GlobalWire -! FUNCTION: Heap32First -! FUNCTION: Heap32ListFirst -! FUNCTION: Heap32ListNext -! FUNCTION: Heap32Next -! FUNCTION: HeapAlloc -! FUNCTION: HeapCompact -! FUNCTION: HeapCreate -! FUNCTION: HeapCreateTagsW -! FUNCTION: HeapDestroy -! FUNCTION: HeapExtend -! FUNCTION: HeapFree -! FUNCTION: HeapLock -! FUNCTION: HeapQueryInformation -! FUNCTION: HeapQueryTagW -! FUNCTION: HeapReAlloc -! FUNCTION: HeapSetInformation -! FUNCTION: HeapSize -! FUNCTION: HeapSummary -! FUNCTION: HeapUnlock -! FUNCTION: HeapUsage -! FUNCTION: HeapValidate -! FUNCTION: HeapWalk -! FUNCTION: InitAtomTable -! FUNCTION: InitializeCriticalSection -! FUNCTION: InitializeCriticalSectionAndSpinCount -! FUNCTION: InitializeSListHead -! FUNCTION: InterlockedCompareExchange -! FUNCTION: InterlockedDecrement -! FUNCTION: InterlockedExchange -! FUNCTION: InterlockedExchangeAdd -! FUNCTION: InterlockedFlushSList -! FUNCTION: InterlockedIncrement -! FUNCTION: InterlockedPopEntrySList -! FUNCTION: InterlockedPushEntrySList -! FUNCTION: InvalidateConsoleDIBits -! FUNCTION: IsBadCodePtr -! FUNCTION: IsBadHugeReadPtr -! FUNCTION: IsBadHugeWritePtr -! FUNCTION: IsBadReadPtr -! FUNCTION: IsBadStringPtrA -! FUNCTION: IsBadStringPtrW -! FUNCTION: IsBadWritePtr -! FUNCTION: IsDBCSLeadByte -! FUNCTION: IsDBCSLeadByteEx -! FUNCTION: IsDebuggerPresent -! FUNCTION: IsProcessInJob -! FUNCTION: IsProcessorFeaturePresent -! FUNCTION: IsSystemResumeAutomatic -! FUNCTION: IsValidCodePage -! FUNCTION: IsValidLanguageGroup -! FUNCTION: IsValidLocale -! FUNCTION: IsValidUILanguage -! FUNCTION: IsWow64Process -! FUNCTION: LCMapStringA -! FUNCTION: LCMapStringW -! FUNCTION: LeaveCriticalSection -! FUNCTION: LoadLibraryA -! FUNCTION: LoadLibraryExA -! FUNCTION: LoadLibraryExW -! FUNCTION: LoadLibraryW -! FUNCTION: LoadModule -! FUNCTION: LoadResource -! FUNCTION: LocalAlloc -! FUNCTION: LocalCompact -! FUNCTION: LocalFileTimeToFileTime -! FUNCTION: LocalFlags -! FUNCTION: LocalFree -! FUNCTION: LocalHandle -! FUNCTION: LocalLock -! FUNCTION: LocalReAlloc -! FUNCTION: LocalShrink -! FUNCTION: LocalSize -! FUNCTION: LocalUnlock -! FUNCTION: LockFile -! FUNCTION: LockFileEx -! FUNCTION: LockResource -! FUNCTION: lstrcat -! FUNCTION: lstrcatA -! FUNCTION: lstrcatW -! FUNCTION: lstrcmp -! FUNCTION: lstrcmpA -! FUNCTION: lstrcmpi -! FUNCTION: lstrcmpiA -! FUNCTION: lstrcmpiW -! FUNCTION: lstrcmpW -! FUNCTION: lstrcpy -! FUNCTION: lstrcpyA -! FUNCTION: lstrcpyn -! FUNCTION: lstrcpynA -! FUNCTION: lstrcpynW -! FUNCTION: lstrcpyW -! FUNCTION: lstrlen -! FUNCTION: lstrlenA -! FUNCTION: lstrlenW -! FUNCTION: LZClose -! FUNCTION: LZCloseFile -! FUNCTION: LZCopy -! FUNCTION: LZCreateFileW -! FUNCTION: LZDone -! FUNCTION: LZInit -! FUNCTION: LZOpenFileA -! FUNCTION: LZOpenFileW -! FUNCTION: LZRead -! FUNCTION: LZSeek -! FUNCTION: LZStart -! FUNCTION: MapUserPhysicalPages -! FUNCTION: MapUserPhysicalPagesScatter -! FUNCTION: MapViewOfFile -! FUNCTION: MapViewOfFileEx -! FUNCTION: Module32First -! FUNCTION: Module32FirstW -! FUNCTION: Module32Next -! FUNCTION: Module32NextW -! FUNCTION: MoveFileA -! FUNCTION: MoveFileExA -! FUNCTION: MoveFileExW -! FUNCTION: MoveFileW -! FUNCTION: MoveFileWithProgressA -! FUNCTION: MoveFileWithProgressW -! FUNCTION: MulDiv -! FUNCTION: MultiByteToWideChar -! FUNCTION: NlsConvertIntegerToString -! FUNCTION: NlsGetCacheUpdateCount -! FUNCTION: NlsResetProcessLocale -! FUNCTION: NumaVirtualQueryNode -! FUNCTION: OpenConsoleW -! FUNCTION: OpenDataFile -! FUNCTION: OpenEventA -! FUNCTION: OpenEventW -! FUNCTION: OpenFile -! FUNCTION: OpenFileMappingA -! FUNCTION: OpenFileMappingW -! FUNCTION: OpenJobObjectA -! FUNCTION: OpenJobObjectW -! FUNCTION: OpenMutexA -! FUNCTION: OpenMutexW -! FUNCTION: OpenProcess -! FUNCTION: OpenProfileUserMapping -! FUNCTION: OpenSemaphoreA -! FUNCTION: OpenSemaphoreW -! FUNCTION: OpenThread -! FUNCTION: OpenWaitableTimerA -! FUNCTION: OpenWaitableTimerW -! FUNCTION: OutputDebugStringA -! FUNCTION: OutputDebugStringW -! FUNCTION: PeekConsoleInputA -! FUNCTION: PeekConsoleInputW -! FUNCTION: PeekNamedPipe -! FUNCTION: PostQueuedCompletionStatus -! FUNCTION: PrepareTape -! FUNCTION: PrivCopyFileExW -! FUNCTION: PrivMoveFileIdentityW -! FUNCTION: Process32First -! FUNCTION: Process32FirstW -! FUNCTION: Process32Next -! FUNCTION: Process32NextW -! FUNCTION: ProcessIdToSessionId -! FUNCTION: PulseEvent -! FUNCTION: PurgeComm -! FUNCTION: QueryActCtxW -! FUNCTION: QueryDepthSList -! FUNCTION: QueryDosDeviceA -! FUNCTION: QueryDosDeviceW -! FUNCTION: QueryInformationJobObject -! FUNCTION: QueryMemoryResourceNotification -! FUNCTION: QueryPerformanceCounter -! FUNCTION: QueryPerformanceFrequency -! FUNCTION: QueryWin31IniFilesMappedToRegistry -! FUNCTION: QueueUserAPC -! FUNCTION: QueueUserWorkItem -! FUNCTION: RaiseException -! FUNCTION: ReadConsoleA -! FUNCTION: ReadConsoleInputA -! FUNCTION: ReadConsoleInputExA -! FUNCTION: ReadConsoleInputExW -! FUNCTION: ReadConsoleInputW -! FUNCTION: ReadConsoleOutputA -! FUNCTION: ReadConsoleOutputAttribute -! FUNCTION: ReadConsoleOutputCharacterA -! FUNCTION: ReadConsoleOutputCharacterW -! FUNCTION: ReadConsoleOutputW -! FUNCTION: ReadConsoleW -! FUNCTION: ReadDirectoryChangesW -! FUNCTION: ReadFile -! FUNCTION: ReadFileEx -! FUNCTION: ReadFileScatter -! FUNCTION: ReadProcessMemory -! FUNCTION: RegisterConsoleIME -! FUNCTION: RegisterConsoleOS2 -! FUNCTION: RegisterConsoleVDM -! FUNCTION: RegisterWaitForInputIdle -! FUNCTION: RegisterWaitForSingleObject -! FUNCTION: RegisterWaitForSingleObjectEx -! FUNCTION: RegisterWowBaseHandlers -! FUNCTION: RegisterWowExec -! FUNCTION: ReleaseActCtx -! FUNCTION: ReleaseMutex -! FUNCTION: ReleaseSemaphore -! FUNCTION: RemoveDirectoryA -! FUNCTION: RemoveDirectoryW -! FUNCTION: RemoveLocalAlternateComputerNameA -! FUNCTION: RemoveLocalAlternateComputerNameW -! FUNCTION: RemoveVectoredExceptionHandler -! FUNCTION: ReplaceFile -! FUNCTION: ReplaceFileA -! FUNCTION: ReplaceFileW -! FUNCTION: RequestDeviceWakeup -! FUNCTION: RequestWakeupLatency -! FUNCTION: ResetEvent -! FUNCTION: ResetWriteWatch -! FUNCTION: RestoreLastError -! FUNCTION: ResumeThread -! FUNCTION: RtlCaptureContext -! FUNCTION: RtlCaptureStackBackTrace -! FUNCTION: RtlFillMemory -! FUNCTION: RtlMoveMemory -! FUNCTION: RtlUnwind -! FUNCTION: RtlZeroMemory -! FUNCTION: ScrollConsoleScreenBufferA -! FUNCTION: ScrollConsoleScreenBufferW -! FUNCTION: SearchPathA -! FUNCTION: SearchPathW -! FUNCTION: SetCalendarInfoA -! FUNCTION: SetCalendarInfoW -! FUNCTION: SetClientTimeZoneInformation -! FUNCTION: SetCommBreak -! FUNCTION: SetCommConfig -! FUNCTION: SetCommMask -! FUNCTION: SetCommState -! FUNCTION: SetCommTimeouts -! FUNCTION: SetComPlusPackageInstallStatus -! FUNCTION: SetComputerNameA -! FUNCTION: SetComputerNameExA -! FUNCTION: SetComputerNameExW -! FUNCTION: SetComputerNameW -! FUNCTION: SetConsoleActiveScreenBuffer -! FUNCTION: SetConsoleCommandHistoryMode -! FUNCTION: SetConsoleCP -! FUNCTION: SetConsoleCtrlHandler -! FUNCTION: SetConsoleCursor -! FUNCTION: SetConsoleCursorInfo -! FUNCTION: SetConsoleCursorMode -! FUNCTION: SetConsoleCursorPosition -! FUNCTION: SetConsoleDisplayMode -! FUNCTION: SetConsoleFont -! FUNCTION: SetConsoleHardwareState -! FUNCTION: SetConsoleIcon -! FUNCTION: SetConsoleInputExeNameA -! FUNCTION: SetConsoleInputExeNameW -! FUNCTION: SetConsoleKeyShortcuts -! FUNCTION: SetConsoleLocalEUDC -! FUNCTION: SetConsoleMaximumWindowSize -! FUNCTION: SetConsoleMenuClose -! FUNCTION: SetConsoleMode -! FUNCTION: SetConsoleNlsMode -! FUNCTION: SetConsoleNumberOfCommandsA -! FUNCTION: SetConsoleNumberOfCommandsW -! FUNCTION: SetConsoleOS2OemFormat -! FUNCTION: SetConsoleOutputCP -! FUNCTION: SetConsolePalette -! FUNCTION: SetConsoleScreenBufferSize -! FUNCTION: SetConsoleTextAttribute -! FUNCTION: SetConsoleTitleA -! FUNCTION: SetConsoleTitleW -! FUNCTION: SetConsoleWindowInfo -! FUNCTION: SetCPGlobal -! FUNCTION: SetCriticalSectionSpinCount -! FUNCTION: SetCurrentDirectoryA -! FUNCTION: SetCurrentDirectoryW -! FUNCTION: SetDefaultCommConfigA -! FUNCTION: SetDefaultCommConfigW -! FUNCTION: SetDllDirectoryA -! FUNCTION: SetDllDirectoryW -! FUNCTION: SetEndOfFile -! FUNCTION: SetEnvironmentVariableA -! FUNCTION: SetEnvironmentVariableW -! FUNCTION: SetErrorMode -! FUNCTION: SetEvent -! FUNCTION: SetFileApisToANSI -! FUNCTION: SetFileApisToOEM -! FUNCTION: SetFileAttributesA -! FUNCTION: SetFileAttributesW -! FUNCTION: SetFilePointer -! FUNCTION: SetFilePointerEx -! FUNCTION: SetFileShortNameA -! FUNCTION: SetFileShortNameW -! FUNCTION: SetFileTime -! FUNCTION: SetFileValidData -! FUNCTION: SetFirmwareEnvironmentVariableA -! FUNCTION: SetFirmwareEnvironmentVariableW -! FUNCTION: SetHandleContext -! FUNCTION: SetHandleCount -! FUNCTION: SetHandleInformation -! FUNCTION: SetInformationJobObject -! FUNCTION: SetLastConsoleEventActive -! FUNCTION: SetLastError -! FUNCTION: SetLocaleInfoA -! FUNCTION: SetLocaleInfoW -! FUNCTION: SetLocalPrimaryComputerNameA -! FUNCTION: SetLocalPrimaryComputerNameW -! FUNCTION: SetLocalTime -! FUNCTION: SetMailslotInfo -! FUNCTION: SetMessageWaitingIndicator -! FUNCTION: SetNamedPipeHandleState -! FUNCTION: SetPriorityClass -! FUNCTION: SetProcessAffinityMask -! FUNCTION: SetProcessPriorityBoost -! FUNCTION: SetProcessShutdownParameters -! FUNCTION: SetProcessWorkingSetSize -! FUNCTION: SetStdHandle -! FUNCTION: SetSystemPowerState -! FUNCTION: SetSystemTime -! FUNCTION: SetSystemTimeAdjustment -! FUNCTION: SetTapeParameters -! FUNCTION: SetTapePosition -! FUNCTION: SetTermsrvAppInstallMode -! FUNCTION: SetThreadAffinityMask -! FUNCTION: SetThreadContext -! FUNCTION: SetThreadExecutionState -! FUNCTION: SetThreadIdealProcessor -! FUNCTION: SetThreadLocale -! FUNCTION: SetThreadPriority -! FUNCTION: SetThreadPriorityBoost -! FUNCTION: SetThreadUILanguage -! FUNCTION: SetTimerQueueTimer -! FUNCTION: SetTimeZoneInformation -! FUNCTION: SetUnhandledExceptionFilter -! FUNCTION: SetupComm -! FUNCTION: SetUserGeoID -! FUNCTION: SetVDMCurrentDirectories -! FUNCTION: SetVolumeLabelA -! FUNCTION: SetVolumeLabelW -! FUNCTION: SetVolumeMountPointA -! FUNCTION: SetVolumeMountPointW -! FUNCTION: SetWaitableTimer -! FUNCTION: ShowConsoleCursor -! FUNCTION: SignalObjectAndWait -! FUNCTION: SizeofResource -! FUNCTION: Sleep -! FUNCTION: SleepEx -! FUNCTION: SuspendThread -! FUNCTION: SwitchToFiber -! FUNCTION: SwitchToThread -! FUNCTION: SystemTimeToFileTime -! FUNCTION: SystemTimeToTzSpecificLocalTime -! FUNCTION: TerminateJobObject -! FUNCTION: TerminateProcess -! FUNCTION: TerminateThread -! FUNCTION: TermsrvAppInstallMode -! FUNCTION: Thread32First -! FUNCTION: Thread32Next -! FUNCTION: TlsAlloc -! FUNCTION: TlsFree -! FUNCTION: TlsGetValue -! FUNCTION: TlsSetValue -! FUNCTION: Toolhelp32ReadProcessMemory -! FUNCTION: TransactNamedPipe -! FUNCTION: TransmitCommChar -! FUNCTION: TrimVirtualBuffer -! FUNCTION: TryEnterCriticalSection -! FUNCTION: TzSpecificLocalTimeToSystemTime -! FUNCTION: UnhandledExceptionFilter -! FUNCTION: UnlockFile -! FUNCTION: UnlockFileEx -! FUNCTION: UnmapViewOfFile -! FUNCTION: UnregisterConsoleIME -! FUNCTION: UnregisterWait -! FUNCTION: UnregisterWaitEx -! FUNCTION: UpdateResourceA -! FUNCTION: UpdateResourceW -! FUNCTION: UTRegister -! FUNCTION: UTUnRegister -! FUNCTION: ValidateLCType -! FUNCTION: ValidateLocale -! FUNCTION: VDMConsoleOperation -! FUNCTION: VDMOperationStarted -! FUNCTION: VerifyConsoleIoHandle -! FUNCTION: VerifyVersionInfoA -! FUNCTION: VerifyVersionInfoW -! FUNCTION: VerLanguageNameA -! FUNCTION: VerLanguageNameW -! FUNCTION: VerSetConditionMask -! FUNCTION: VirtualAlloc -! FUNCTION: VirtualAllocEx -! FUNCTION: VirtualBufferExceptionHandler -! FUNCTION: VirtualFree -! FUNCTION: VirtualFreeEx -! FUNCTION: VirtualLock -! FUNCTION: VirtualProtect -! FUNCTION: VirtualProtectEx -! FUNCTION: VirtualQuery -! FUNCTION: VirtualQueryEx -! FUNCTION: VirtualUnlock -! FUNCTION: WaitCommEvent -! FUNCTION: WaitForDebugEvent -! FUNCTION: WaitForMultipleObjects -! FUNCTION: WaitForMultipleObjectsEx -! FUNCTION: WaitForSingleObject -! FUNCTION: WaitForSingleObjectEx -! FUNCTION: WaitNamedPipeA -! FUNCTION: WaitNamedPipeW -! FUNCTION: WideCharToMultiByte -! FUNCTION: WinExec -! FUNCTION: WriteConsoleA -! FUNCTION: WriteConsoleInputA -! FUNCTION: WriteConsoleInputVDMA -! FUNCTION: WriteConsoleInputVDMW -! FUNCTION: WriteConsoleInputW -! FUNCTION: WriteConsoleOutputA -! FUNCTION: WriteConsoleOutputAttribute -! FUNCTION: WriteConsoleOutputCharacterA -! FUNCTION: WriteConsoleOutputCharacterW -! FUNCTION: WriteConsoleOutputW -! FUNCTION: WriteConsoleW -! FUNCTION: WriteFile -! FUNCTION: WriteFileEx -! FUNCTION: WriteFileGather -! FUNCTION: WritePrivateProfileSectionA -! FUNCTION: WritePrivateProfileSectionW -! FUNCTION: WritePrivateProfileStringA -! FUNCTION: WritePrivateProfileStringW -! FUNCTION: WritePrivateProfileStructA -! FUNCTION: WritePrivateProfileStructW -! FUNCTION: WriteProcessMemory -! FUNCTION: WriteProfileSectionA -! FUNCTION: WriteProfileSectionW -! FUNCTION: WriteProfileStringA -! FUNCTION: WriteProfileStringW -! FUNCTION: WriteTapemark -! FUNCTION: WTSGetActiveConsoleSessionId -! FUNCTION: ZombifyActCtx diff --git a/library/windows/kernel32.factor b/library/windows/kernel32.factor index f6f1d4624a..22c559169d 100644 --- a/library/windows/kernel32.factor +++ b/library/windows/kernel32.factor @@ -1,57 +1,955 @@ -! Copyright (C) 2005, 2006 Doug Coleman. -! See http://factor.sf.net/license.txt for BSD license. -USING: alien kernel errors ; -IN: win32-api - -LIBRARY: kernel32 - - -! FUNCTION: DWORD FormatMessage( - ! DWORD dwFlags, - ! LPCVOID lpSource, - ! DWORD dwMessageId, - ! DWORD dwLanguageId, - ! LPTSTR lpBuffer, - ! DWORD nSize, - ! va_list* Arguments -! ) ; - - -! FUNCTION: HMODULE GetModuleHandleA ( LPCTSTR lpModulename ) ; -! FUNCTION: HMODULE GetModuleHandleW ( LPCWSTR lpModulename ) ; - -FUNCTION: HMODULE GetModuleHandleA ( void* lpModulename ) ; -FUNCTION: HMODULE GetModuleHandleW ( void* lpModulename ) ; - -: GetModuleHandle \ GetModuleHandleW \ GetModuleHandleA unicode-exec ; - - -! FUNCTION: HMODULE GetModuleHandleEx ( -! DWORD dwFlags, -! LPCTSTR lpModulename, -! HMODULE* phModule ) ; - - - -FUNCTION: DWORD GetLastError ( ) ; - -: (win32-error) ( id -- string ) - "char*" f "error_message" [ "int" ] alien-invoke ; - -: win32-error ( -- ) - GetLastError dup 0 = [ (win32-error) throw ] unless drop ; - -: GHND HEX: 40 ; inline -: GMEM_FIXED 0 ; inline -: GMEM_MOVEABLE 2 ; inline -: GMEM_ZEROINIT HEX: 40 ; inline -: GPTR HEX: 40 ; inline - -FUNCTION: HGLOBAL GlobalAlloc ( UINT uFlags, SIZE_T dwBytes ) ; -FUNCTION: LPVOID GlobalLock ( HGLOBAL hMem ) ; -! FUNCTION: char* GlobalLock ( HGLOBAL hMem ) ; -FUNCTION: BOOL GlobalUnlock ( HGLOBAL hMem ) ; - -FUNCTION: DWORD SleepEx ( DWORD dwMilliSeconds, BOOL bAlertable ) ; - - +IN: win32-api + +LIBRARY: kernel32 +! FUNCTION: _hread +! FUNCTION: _hwrite +! FUNCTION: _lclose +! FUNCTION: _lcreat +! FUNCTION: _llseek +! FUNCTION: _lopen +! FUNCTION: _lread +! FUNCTION: _lwrite +! FUNCTION: ActivateActCtx +! FUNCTION: AddAtomA +! FUNCTION: AddAtomW +! FUNCTION: AddConsoleAliasA +! FUNCTION: AddConsoleAliasW +! FUNCTION: AddLocalAlternateComputerNameA +! FUNCTION: AddLocalAlternateComputerNameW +! FUNCTION: AddRefActCtx +! FUNCTION: AddVectoredExceptionHandler +! FUNCTION: AllocateUserPhysicalPages +! FUNCTION: AllocConsole +! FUNCTION: AreFileApisANSI +! FUNCTION: AssignProcessToJobObject +! FUNCTION: AttachConsole +! FUNCTION: BackupRead +! FUNCTION: BackupSeek +! FUNCTION: BackupWrite +! FUNCTION: BaseCheckAppcompatCache +! FUNCTION: BaseCleanupAppcompatCache +! FUNCTION: BaseCleanupAppcompatCacheSupport +! FUNCTION: BaseDumpAppcompatCache +! FUNCTION: BaseFlushAppcompatCache +! FUNCTION: BaseInitAppcompatCache +! FUNCTION: BaseInitAppcompatCacheSupport +! FUNCTION: BasepCheckWinSaferRestrictions +! FUNCTION: BaseProcessInitPostImport +! FUNCTION: BaseQueryModuleData +! FUNCTION: BaseUpdateAppcompatCache +! FUNCTION: Beep +! FUNCTION: BeginUpdateResourceA +! FUNCTION: BeginUpdateResourceW +! FUNCTION: BindIoCompletionCallback +! FUNCTION: BuildCommDCBA +! FUNCTION: BuildCommDCBAndTimeoutsA +! FUNCTION: BuildCommDCBAndTimeoutsW +! FUNCTION: BuildCommDCBW +! FUNCTION: CallNamedPipeA +! FUNCTION: CallNamedPipeW +! FUNCTION: CancelDeviceWakeupRequest +! FUNCTION: CancelIo +! FUNCTION: CancelTimerQueueTimer +! FUNCTION: CancelWaitableTimer +! FUNCTION: ChangeTimerQueueTimer +! FUNCTION: CheckNameLegalDOS8Dot3A +! FUNCTION: CheckNameLegalDOS8Dot3W +! FUNCTION: CheckRemoteDebuggerPresent +! FUNCTION: ClearCommBreak +! FUNCTION: ClearCommError +! FUNCTION: CloseConsoleHandle +! FUNCTION: CloseHandle +! FUNCTION: CloseProfileUserMapping +! FUNCTION: CmdBatNotification +! FUNCTION: CommConfigDialogA +! FUNCTION: CommConfigDialogW +! FUNCTION: CompareFileTime +! FUNCTION: CompareStringA +! FUNCTION: CompareStringW +! FUNCTION: ConnectNamedPipe +! FUNCTION: ConsoleMenuControl +! FUNCTION: ContinueDebugEvent +! FUNCTION: ConvertDefaultLocale +! FUNCTION: ConvertFiberToThread +! FUNCTION: ConvertThreadToFiber +! FUNCTION: CopyFileA +! FUNCTION: CopyFileExA +! FUNCTION: CopyFileExW +! FUNCTION: CopyFileW +! FUNCTION: CopyLZFile +! FUNCTION: CreateActCtxA +! FUNCTION: CreateActCtxW +! FUNCTION: CreateConsoleScreenBuffer +! FUNCTION: CreateDirectoryA +! FUNCTION: CreateDirectoryExA +! FUNCTION: CreateDirectoryExW +! FUNCTION: CreateDirectoryW +! FUNCTION: CreateEventA +! FUNCTION: CreateEventW +! FUNCTION: CreateFiber +! FUNCTION: CreateFiberEx +! FUNCTION: CreateFileA +! FUNCTION: CreateFileMappingA +! FUNCTION: CreateFileMappingW +! FUNCTION: CreateFileW +! FUNCTION: CreateHardLinkA +! FUNCTION: CreateHardLinkW +! FUNCTION: CreateIoCompletionPort +! FUNCTION: CreateJobObjectA +! FUNCTION: CreateJobObjectW +! FUNCTION: CreateJobSet +! FUNCTION: CreateMailslotA +! FUNCTION: CreateMailslotW +! FUNCTION: CreateMemoryResourceNotification +! FUNCTION: CreateMutexA +! FUNCTION: CreateMutexW +! FUNCTION: CreateNamedPipeA +! FUNCTION: CreateNamedPipeW +! FUNCTION: CreateNlsSecurityDescriptor +! FUNCTION: CreatePipe +! FUNCTION: CreateProcessA +! FUNCTION: CreateProcessInternalA +! FUNCTION: CreateProcessInternalW +! FUNCTION: CreateProcessInternalWSecure +! FUNCTION: CreateProcessW +! FUNCTION: CreateRemoteThread +! FUNCTION: CreateSemaphoreA +! FUNCTION: CreateSemaphoreW +! FUNCTION: CreateSocketHandle +! FUNCTION: CreateTapePartition +! FUNCTION: CreateThread +! FUNCTION: CreateTimerQueue +! FUNCTION: CreateTimerQueueTimer +! FUNCTION: CreateToolhelp32Snapshot +! FUNCTION: CreateVirtualBuffer +! FUNCTION: CreateWaitableTimerA +! FUNCTION: CreateWaitableTimerW +! FUNCTION: DeactivateActCtx +! FUNCTION: DebugActiveProcess +! FUNCTION: DebugActiveProcessStop +! FUNCTION: DebugBreak +! FUNCTION: DebugBreakProcess +! FUNCTION: DebugSetProcessKillOnExit +! FUNCTION: DecodePointer +! FUNCTION: DecodeSystemPointer +! FUNCTION: DefineDosDeviceA +! FUNCTION: DefineDosDeviceW +! FUNCTION: DelayLoadFailureHook +! FUNCTION: DeleteAtom +! FUNCTION: DeleteCriticalSection +! FUNCTION: DeleteFiber +! FUNCTION: DeleteFileA +! FUNCTION: DeleteFileW +! FUNCTION: DeleteTimerQueue +! FUNCTION: DeleteTimerQueueEx +! FUNCTION: DeleteTimerQueueTimer +! FUNCTION: DeleteVolumeMountPointA +! FUNCTION: DeleteVolumeMountPointW +! FUNCTION: DeviceIoControl +! FUNCTION: DisableThreadLibraryCalls +! FUNCTION: DisconnectNamedPipe +! FUNCTION: DnsHostnameToComputerNameA +! FUNCTION: DnsHostnameToComputerNameW +! FUNCTION: DosDateTimeToFileTime +! FUNCTION: DosPathToSessionPathA +! FUNCTION: DosPathToSessionPathW +! FUNCTION: DuplicateConsoleHandle +! FUNCTION: DuplicateHandle +! FUNCTION: EncodePointer +! FUNCTION: EncodeSystemPointer +! FUNCTION: EndUpdateResourceA +! FUNCTION: EndUpdateResourceW +! FUNCTION: EnterCriticalSection +! FUNCTION: EnumCalendarInfoA +! FUNCTION: EnumCalendarInfoExA +! FUNCTION: EnumCalendarInfoExW +! FUNCTION: EnumCalendarInfoW +! FUNCTION: EnumDateFormatsA +! FUNCTION: EnumDateFormatsExA +! FUNCTION: EnumDateFormatsExW +! FUNCTION: EnumDateFormatsW +! FUNCTION: EnumerateLocalComputerNamesA +! FUNCTION: EnumerateLocalComputerNamesW +! FUNCTION: EnumLanguageGroupLocalesA +! FUNCTION: EnumLanguageGroupLocalesW +! FUNCTION: EnumResourceLanguagesA +! FUNCTION: EnumResourceLanguagesW +! FUNCTION: EnumResourceNamesA +! FUNCTION: EnumResourceNamesW +! FUNCTION: EnumResourceTypesA +! FUNCTION: EnumResourceTypesW +! FUNCTION: EnumSystemCodePagesA +! FUNCTION: EnumSystemCodePagesW +! FUNCTION: EnumSystemGeoID +! FUNCTION: EnumSystemLanguageGroupsA +! FUNCTION: EnumSystemLanguageGroupsW +! FUNCTION: EnumSystemLocalesA +! FUNCTION: EnumSystemLocalesW +! FUNCTION: EnumTimeFormatsA +! FUNCTION: EnumTimeFormatsW +! FUNCTION: EnumUILanguagesA +! FUNCTION: EnumUILanguagesW +! FUNCTION: EraseTape +! FUNCTION: EscapeCommFunction +! FUNCTION: ExitProcess +! FUNCTION: ExitThread +! FUNCTION: ExitVDM +! FUNCTION: ExpandEnvironmentStringsA +! FUNCTION: ExpandEnvironmentStringsW +! FUNCTION: ExpungeConsoleCommandHistoryA +! FUNCTION: ExpungeConsoleCommandHistoryW +! FUNCTION: ExtendVirtualBuffer +! FUNCTION: FatalAppExitA +! FUNCTION: FatalAppExitW +! FUNCTION: FatalExit +! FUNCTION: FileTimeToDosDateTime +! FUNCTION: FileTimeToLocalFileTime +! FUNCTION: FileTimeToSystemTime +! FUNCTION: FillConsoleOutputAttribute +! FUNCTION: FillConsoleOutputCharacterA +! FUNCTION: FillConsoleOutputCharacterW +! FUNCTION: FindActCtxSectionGuid +! FUNCTION: FindActCtxSectionStringA +! FUNCTION: FindActCtxSectionStringW +! FUNCTION: FindAtomA +! FUNCTION: FindAtomW +! FUNCTION: FindClose +! FUNCTION: FindCloseChangeNotification +! FUNCTION: FindFirstChangeNotificationA +! FUNCTION: FindFirstChangeNotificationW +! FUNCTION: FindFirstFileA +! FUNCTION: FindFirstFileExA +! FUNCTION: FindFirstFileExW +! FUNCTION: FindFirstFileW +! FUNCTION: FindFirstVolumeA +! FUNCTION: FindFirstVolumeMountPointA +! FUNCTION: FindFirstVolumeMountPointW +! FUNCTION: FindFirstVolumeW +! FUNCTION: FindNextChangeNotification +! FUNCTION: FindNextFileA +! FUNCTION: FindNextFileW +! FUNCTION: FindNextVolumeA +! FUNCTION: FindNextVolumeMountPointA +! FUNCTION: FindNextVolumeMountPointW +! FUNCTION: FindNextVolumeW +! FUNCTION: FindResourceA +! FUNCTION: FindResourceExA +! FUNCTION: FindResourceExW +! FUNCTION: FindResourceW +! FUNCTION: FindVolumeClose +! FUNCTION: FindVolumeMountPointClose +! FUNCTION: FlushConsoleInputBuffer +! FUNCTION: FlushFileBuffers +! FUNCTION: FlushInstructionCache +! FUNCTION: FlushViewOfFile +! FUNCTION: FoldStringA +! FUNCTION: FoldStringW +! FUNCTION: FormatMessageA +! FUNCTION: FormatMessageW +! FUNCTION: FreeConsole +! FUNCTION: FreeEnvironmentStringsA +! FUNCTION: FreeEnvironmentStringsW +! FUNCTION: FreeLibrary +! FUNCTION: FreeLibraryAndExitThread +! FUNCTION: FreeResource +! FUNCTION: FreeUserPhysicalPages +! FUNCTION: FreeVirtualBuffer +! FUNCTION: GenerateConsoleCtrlEvent +! FUNCTION: GetACP +! FUNCTION: GetAtomNameA +! FUNCTION: GetAtomNameW +! FUNCTION: GetBinaryType +! FUNCTION: GetBinaryTypeA +! FUNCTION: GetBinaryTypeW +! FUNCTION: GetCalendarInfoA +! FUNCTION: GetCalendarInfoW +! FUNCTION: GetCommandLineA +! FUNCTION: GetCommandLineW +! FUNCTION: GetCommConfig +! FUNCTION: GetCommMask +! FUNCTION: GetCommModemStatus +! FUNCTION: GetCommProperties +! FUNCTION: GetCommState +! FUNCTION: GetCommTimeouts +! FUNCTION: GetComPlusPackageInstallStatus +! FUNCTION: GetCompressedFileSizeA +! FUNCTION: GetCompressedFileSizeW +! FUNCTION: GetComputerNameA +! FUNCTION: GetComputerNameExA +! FUNCTION: GetComputerNameExW +! FUNCTION: GetComputerNameW +! FUNCTION: GetConsoleAliasA +! FUNCTION: GetConsoleAliasesA +! FUNCTION: GetConsoleAliasesLengthA +! FUNCTION: GetConsoleAliasesLengthW +! FUNCTION: GetConsoleAliasesW +! FUNCTION: GetConsoleAliasExesA +! FUNCTION: GetConsoleAliasExesLengthA +! FUNCTION: GetConsoleAliasExesLengthW +! FUNCTION: GetConsoleAliasExesW +! FUNCTION: GetConsoleAliasW +! FUNCTION: GetConsoleCharType +! FUNCTION: GetConsoleCommandHistoryA +! FUNCTION: GetConsoleCommandHistoryLengthA +! FUNCTION: GetConsoleCommandHistoryLengthW +! FUNCTION: GetConsoleCommandHistoryW +! FUNCTION: GetConsoleCP +! FUNCTION: GetConsoleCursorInfo +! FUNCTION: GetConsoleCursorMode +! FUNCTION: GetConsoleDisplayMode +! FUNCTION: GetConsoleFontInfo +! FUNCTION: GetConsoleFontSize +! FUNCTION: GetConsoleHardwareState +! FUNCTION: GetConsoleInputExeNameA +! FUNCTION: GetConsoleInputExeNameW +! FUNCTION: GetConsoleInputWaitHandle +! FUNCTION: GetConsoleKeyboardLayoutNameA +! FUNCTION: GetConsoleKeyboardLayoutNameW +! FUNCTION: GetConsoleMode +! FUNCTION: GetConsoleNlsMode +! FUNCTION: GetConsoleOutputCP +! FUNCTION: GetConsoleProcessList +! FUNCTION: GetConsoleScreenBufferInfo +! FUNCTION: GetConsoleSelectionInfo +! FUNCTION: GetConsoleTitleA +! FUNCTION: GetConsoleTitleW +! FUNCTION: GetConsoleWindow +! FUNCTION: GetCPFileNameFromRegistry +! FUNCTION: GetCPInfo +! FUNCTION: GetCPInfoExA +! FUNCTION: GetCPInfoExW +! FUNCTION: GetCurrencyFormatA +! FUNCTION: GetCurrencyFormatW +! FUNCTION: GetCurrentActCtx +! FUNCTION: GetCurrentConsoleFont +! FUNCTION: GetCurrentDirectoryA +! FUNCTION: GetCurrentDirectoryW +! FUNCTION: GetCurrentProcess +! FUNCTION: GetCurrentProcessId +! FUNCTION: GetCurrentThread +! FUNCTION: GetCurrentThreadId +! FUNCTION: GetDateFormatA +! FUNCTION: GetDateFormatW +! FUNCTION: GetDefaultCommConfigA +! FUNCTION: GetDefaultCommConfigW +! FUNCTION: GetDefaultSortkeySize +! FUNCTION: GetDevicePowerState +! FUNCTION: GetDiskFreeSpaceA +! FUNCTION: GetDiskFreeSpaceExA +! FUNCTION: GetDiskFreeSpaceExW +! FUNCTION: GetDiskFreeSpaceW +! FUNCTION: GetDllDirectoryA +! FUNCTION: GetDllDirectoryW +! FUNCTION: GetDriveTypeA +! FUNCTION: GetDriveTypeW +! FUNCTION: GetEnvironmentStrings +! FUNCTION: GetEnvironmentStringsA +! FUNCTION: GetEnvironmentStringsW +! FUNCTION: GetEnvironmentVariableA +! FUNCTION: GetEnvironmentVariableW +! FUNCTION: GetExitCodeProcess +! FUNCTION: GetExitCodeThread +! FUNCTION: GetExpandedNameA +! FUNCTION: GetExpandedNameW +! FUNCTION: GetFileAttributesA +! FUNCTION: GetFileAttributesExA +! FUNCTION: GetFileAttributesExW +! FUNCTION: GetFileAttributesW +! FUNCTION: GetFileInformationByHandle +! FUNCTION: GetFileSize +! FUNCTION: GetFileSizeEx +! FUNCTION: GetFileTime +! FUNCTION: GetFileType +! FUNCTION: GetFirmwareEnvironmentVariableA +! FUNCTION: GetFirmwareEnvironmentVariableW +! FUNCTION: GetFullPathNameA +! FUNCTION: GetFullPathNameW +! FUNCTION: GetGeoInfoA +! FUNCTION: GetGeoInfoW +! FUNCTION: GetHandleContext +! FUNCTION: GetHandleInformation +! FUNCTION: GetLargestConsoleWindowSize +FUNCTION: DWORD GetLastError ( ) ; +! FUNCTION: GetLinguistLangSize +! FUNCTION: GetLocaleInfoA +! FUNCTION: GetLocaleInfoW +! FUNCTION: GetLocalTime +! FUNCTION: GetLogicalDrives +! FUNCTION: GetLogicalDriveStringsA +! FUNCTION: GetLogicalDriveStringsW +! FUNCTION: GetLongPathNameA +! FUNCTION: GetLongPathNameW +! FUNCTION: GetMailslotInfo +! FUNCTION: GetModuleFileNameA +! FUNCTION: GetModuleFileNameW +FUNCTION: HMODULE GetModuleHandleA ( LPCTSTR lpModuleName ) ; +FUNCTION: HMODULE GetModuleHandleW ( LPCWSTR lpModuleName ) ; + +: GetModuleHandle \ GetModuleHandleW \ GetModuleHandleA unicode-exec ; + +! FUNCTION: GetModuleHandleExA +! FUNCTION: GetModuleHandleExW +! FUNCTION: GetNamedPipeHandleStateA +! FUNCTION: GetNamedPipeHandleStateW +! FUNCTION: GetNamedPipeInfo +! FUNCTION: GetNativeSystemInfo +! FUNCTION: GetNextVDMCommand +! FUNCTION: GetNlsSectionName +! FUNCTION: GetNumaAvailableMemory +! FUNCTION: GetNumaAvailableMemoryNode +! FUNCTION: GetNumaHighestNodeNumber +! FUNCTION: GetNumaNodeProcessorMask +! FUNCTION: GetNumaProcessorMap +! FUNCTION: GetNumaProcessorNode +! FUNCTION: GetNumberFormatA +! FUNCTION: GetNumberFormatW +! FUNCTION: GetNumberOfConsoleFonts +! FUNCTION: GetNumberOfConsoleInputEvents +! FUNCTION: GetNumberOfConsoleMouseButtons +! FUNCTION: GetOEMCP +! FUNCTION: GetOverlappedResult +! FUNCTION: GetPriorityClass +! FUNCTION: GetPrivateProfileIntA +! FUNCTION: GetPrivateProfileIntW +! FUNCTION: GetPrivateProfileSectionA +! FUNCTION: GetPrivateProfileSectionNamesA +! FUNCTION: GetPrivateProfileSectionNamesW +! FUNCTION: GetPrivateProfileSectionW +! FUNCTION: GetPrivateProfileStringA +! FUNCTION: GetPrivateProfileStringW +! FUNCTION: GetPrivateProfileStructA +! FUNCTION: GetPrivateProfileStructW +! FUNCTION: GetProcAddress +! FUNCTION: GetProcessAffinityMask +! FUNCTION: GetProcessHandleCount +! FUNCTION: GetProcessHeap +! FUNCTION: GetProcessHeaps +! FUNCTION: GetProcessId +! FUNCTION: GetProcessIoCounters +! FUNCTION: GetProcessPriorityBoost +! FUNCTION: GetProcessShutdownParameters +! FUNCTION: GetProcessTimes +! FUNCTION: GetProcessVersion +! FUNCTION: GetProcessWorkingSetSize +! FUNCTION: GetProfileIntA +! FUNCTION: GetProfileIntW +! FUNCTION: GetProfileSectionA +! FUNCTION: GetProfileSectionW +! FUNCTION: GetProfileStringA +! FUNCTION: GetProfileStringW +! FUNCTION: GetQueuedCompletionStatus +! FUNCTION: GetShortPathNameA +! FUNCTION: GetShortPathNameW +! FUNCTION: GetStartupInfoA +! FUNCTION: GetStartupInfoW +! FUNCTION: GetStdHandle +! FUNCTION: GetStringTypeA +! FUNCTION: GetStringTypeExA +! FUNCTION: GetStringTypeExW +! FUNCTION: GetStringTypeW +! FUNCTION: GetSystemDefaultLangID +! FUNCTION: GetSystemDefaultLCID +! FUNCTION: GetSystemDefaultUILanguage +! FUNCTION: GetSystemDirectoryA +! FUNCTION: GetSystemDirectoryW +! FUNCTION: GetSystemInfo +! FUNCTION: GetSystemPowerStatus +! FUNCTION: GetSystemRegistryQuota +! FUNCTION: GetSystemTime +! FUNCTION: GetSystemTimeAdjustment +! FUNCTION: GetSystemTimeAsFileTime +! FUNCTION: GetSystemTimes +! FUNCTION: GetSystemWindowsDirectoryA +! FUNCTION: GetSystemWindowsDirectoryW +! FUNCTION: GetSystemWow64DirectoryA +! FUNCTION: GetSystemWow64DirectoryW +! FUNCTION: GetTapeParameters +! FUNCTION: GetTapePosition +! FUNCTION: GetTapeStatus +! FUNCTION: GetTempFileNameA +! FUNCTION: GetTempFileNameW +! FUNCTION: GetTempPathA +! FUNCTION: GetTempPathW +! FUNCTION: GetThreadContext +! FUNCTION: GetThreadIOPendingFlag +! FUNCTION: GetThreadLocale +! FUNCTION: GetThreadPriority +! FUNCTION: GetThreadPriorityBoost +! FUNCTION: GetThreadSelectorEntry +! FUNCTION: GetThreadTimes +! FUNCTION: GetTickCount +! FUNCTION: GetTimeFormatA +! FUNCTION: GetTimeFormatW +! FUNCTION: GetTimeZoneInformation +! FUNCTION: GetUserDefaultLangID +! FUNCTION: GetUserDefaultLCID +! FUNCTION: GetUserDefaultUILanguage +! FUNCTION: GetUserGeoID +! FUNCTION: GetVDMCurrentDirectories +! FUNCTION: GetVersion +! FUNCTION: GetVersionExA +! FUNCTION: GetVersionExW +! FUNCTION: GetVolumeInformationA +! FUNCTION: GetVolumeInformationW +! FUNCTION: GetVolumeNameForVolumeMountPointA +! FUNCTION: GetVolumeNameForVolumeMountPointW +! FUNCTION: GetVolumePathNameA +! FUNCTION: GetVolumePathNamesForVolumeNameA +! FUNCTION: GetVolumePathNamesForVolumeNameW +! FUNCTION: GetVolumePathNameW +! FUNCTION: GetWindowsDirectoryA +! FUNCTION: GetWindowsDirectoryW +! FUNCTION: GetWriteWatch +! FUNCTION: GlobalAddAtomA +! FUNCTION: GlobalAddAtomW +FUNCTION: HGLOBAL GlobalAlloc ( UINT uFlags, SIZE_T dwBytes ) ; +! FUNCTION: GlobalCompact +! FUNCTION: GlobalDeleteAtom +! FUNCTION: GlobalFindAtomA +! FUNCTION: GlobalFindAtomW +! FUNCTION: GlobalFix +! FUNCTION: GlobalFlags +! FUNCTION: GlobalFree +! FUNCTION: GlobalGetAtomNameA +! FUNCTION: GlobalGetAtomNameW +! FUNCTION: GlobalHandle +FUNCTION: LPVOID GlobalLock ( HGLOBAL hMem ) ; +! FUNCTION: GlobalMemoryStatus +! FUNCTION: GlobalMemoryStatusEx +! FUNCTION: GlobalReAlloc +! FUNCTION: GlobalSize +! FUNCTION: GlobalUnfix +FUNCTION: BOOL GlobalUnlock ( HGLOBAL hMem ) ; +! FUNCTION: GlobalUnWire +! FUNCTION: GlobalWire +! FUNCTION: Heap32First +! FUNCTION: Heap32ListFirst +! FUNCTION: Heap32ListNext +! FUNCTION: Heap32Next +! FUNCTION: HeapAlloc +! FUNCTION: HeapCompact +! FUNCTION: HeapCreate +! FUNCTION: HeapCreateTagsW +! FUNCTION: HeapDestroy +! FUNCTION: HeapExtend +! FUNCTION: HeapFree +! FUNCTION: HeapLock +! FUNCTION: HeapQueryInformation +! FUNCTION: HeapQueryTagW +! FUNCTION: HeapReAlloc +! FUNCTION: HeapSetInformation +! FUNCTION: HeapSize +! FUNCTION: HeapSummary +! FUNCTION: HeapUnlock +! FUNCTION: HeapUsage +! FUNCTION: HeapValidate +! FUNCTION: HeapWalk +! FUNCTION: InitAtomTable +! FUNCTION: InitializeCriticalSection +! FUNCTION: InitializeCriticalSectionAndSpinCount +! FUNCTION: InitializeSListHead +! FUNCTION: InterlockedCompareExchange +! FUNCTION: InterlockedDecrement +! FUNCTION: InterlockedExchange +! FUNCTION: InterlockedExchangeAdd +! FUNCTION: InterlockedFlushSList +! FUNCTION: InterlockedIncrement +! FUNCTION: InterlockedPopEntrySList +! FUNCTION: InterlockedPushEntrySList +! FUNCTION: InvalidateConsoleDIBits +! FUNCTION: IsBadCodePtr +! FUNCTION: IsBadHugeReadPtr +! FUNCTION: IsBadHugeWritePtr +! FUNCTION: IsBadReadPtr +! FUNCTION: IsBadStringPtrA +! FUNCTION: IsBadStringPtrW +! FUNCTION: IsBadWritePtr +! FUNCTION: IsDBCSLeadByte +! FUNCTION: IsDBCSLeadByteEx +! FUNCTION: IsDebuggerPresent +! FUNCTION: IsProcessInJob +! FUNCTION: IsProcessorFeaturePresent +! FUNCTION: IsSystemResumeAutomatic +! FUNCTION: IsValidCodePage +! FUNCTION: IsValidLanguageGroup +! FUNCTION: IsValidLocale +! FUNCTION: IsValidUILanguage +! FUNCTION: IsWow64Process +! FUNCTION: LCMapStringA +! FUNCTION: LCMapStringW +! FUNCTION: LeaveCriticalSection +! FUNCTION: LoadLibraryA +! FUNCTION: LoadLibraryExA +! FUNCTION: LoadLibraryExW +! FUNCTION: LoadLibraryW +! FUNCTION: LoadModule +! FUNCTION: LoadResource +! FUNCTION: LocalAlloc +! FUNCTION: LocalCompact +! FUNCTION: LocalFileTimeToFileTime +! FUNCTION: LocalFlags +! FUNCTION: LocalFree +! FUNCTION: LocalHandle +! FUNCTION: LocalLock +! FUNCTION: LocalReAlloc +! FUNCTION: LocalShrink +! FUNCTION: LocalSize +! FUNCTION: LocalUnlock +! FUNCTION: LockFile +! FUNCTION: LockFileEx +! FUNCTION: LockResource +! FUNCTION: lstrcat +! FUNCTION: lstrcatA +! FUNCTION: lstrcatW +! FUNCTION: lstrcmp +! FUNCTION: lstrcmpA +! FUNCTION: lstrcmpi +! FUNCTION: lstrcmpiA +! FUNCTION: lstrcmpiW +! FUNCTION: lstrcmpW +! FUNCTION: lstrcpy +! FUNCTION: lstrcpyA +! FUNCTION: lstrcpyn +! FUNCTION: lstrcpynA +! FUNCTION: lstrcpynW +! FUNCTION: lstrcpyW +! FUNCTION: lstrlen +! FUNCTION: lstrlenA +! FUNCTION: lstrlenW +! FUNCTION: LZClose +! FUNCTION: LZCloseFile +! FUNCTION: LZCopy +! FUNCTION: LZCreateFileW +! FUNCTION: LZDone +! FUNCTION: LZInit +! FUNCTION: LZOpenFileA +! FUNCTION: LZOpenFileW +! FUNCTION: LZRead +! FUNCTION: LZSeek +! FUNCTION: LZStart +! FUNCTION: MapUserPhysicalPages +! FUNCTION: MapUserPhysicalPagesScatter +! FUNCTION: MapViewOfFile +! FUNCTION: MapViewOfFileEx +! FUNCTION: Module32First +! FUNCTION: Module32FirstW +! FUNCTION: Module32Next +! FUNCTION: Module32NextW +! FUNCTION: MoveFileA +! FUNCTION: MoveFileExA +! FUNCTION: MoveFileExW +! FUNCTION: MoveFileW +! FUNCTION: MoveFileWithProgressA +! FUNCTION: MoveFileWithProgressW +! FUNCTION: MulDiv +! FUNCTION: MultiByteToWideChar +! FUNCTION: NlsConvertIntegerToString +! FUNCTION: NlsGetCacheUpdateCount +! FUNCTION: NlsResetProcessLocale +! FUNCTION: NumaVirtualQueryNode +! FUNCTION: OpenConsoleW +! FUNCTION: OpenDataFile +! FUNCTION: OpenEventA +! FUNCTION: OpenEventW +! FUNCTION: OpenFile +! FUNCTION: OpenFileMappingA +! FUNCTION: OpenFileMappingW +! FUNCTION: OpenJobObjectA +! FUNCTION: OpenJobObjectW +! FUNCTION: OpenMutexA +! FUNCTION: OpenMutexW +! FUNCTION: OpenProcess +! FUNCTION: OpenProfileUserMapping +! FUNCTION: OpenSemaphoreA +! FUNCTION: OpenSemaphoreW +! FUNCTION: OpenThread +! FUNCTION: OpenWaitableTimerA +! FUNCTION: OpenWaitableTimerW +! FUNCTION: OutputDebugStringA +! FUNCTION: OutputDebugStringW +! FUNCTION: PeekConsoleInputA +! FUNCTION: PeekConsoleInputW +! FUNCTION: PeekNamedPipe +! FUNCTION: PostQueuedCompletionStatus +! FUNCTION: PrepareTape +! FUNCTION: PrivCopyFileExW +! FUNCTION: PrivMoveFileIdentityW +! FUNCTION: Process32First +! FUNCTION: Process32FirstW +! FUNCTION: Process32Next +! FUNCTION: Process32NextW +! FUNCTION: ProcessIdToSessionId +! FUNCTION: PulseEvent +! FUNCTION: PurgeComm +! FUNCTION: QueryActCtxW +! FUNCTION: QueryDepthSList +! FUNCTION: QueryDosDeviceA +! FUNCTION: QueryDosDeviceW +! FUNCTION: QueryInformationJobObject +! FUNCTION: QueryMemoryResourceNotification +! FUNCTION: QueryPerformanceCounter +! FUNCTION: QueryPerformanceFrequency +! FUNCTION: QueryWin31IniFilesMappedToRegistry +! FUNCTION: QueueUserAPC +! FUNCTION: QueueUserWorkItem +! FUNCTION: RaiseException +! FUNCTION: ReadConsoleA +! FUNCTION: ReadConsoleInputA +! FUNCTION: ReadConsoleInputExA +! FUNCTION: ReadConsoleInputExW +! FUNCTION: ReadConsoleInputW +! FUNCTION: ReadConsoleOutputA +! FUNCTION: ReadConsoleOutputAttribute +! FUNCTION: ReadConsoleOutputCharacterA +! FUNCTION: ReadConsoleOutputCharacterW +! FUNCTION: ReadConsoleOutputW +! FUNCTION: ReadConsoleW +! FUNCTION: ReadDirectoryChangesW +! FUNCTION: ReadFile +! FUNCTION: ReadFileEx +! FUNCTION: ReadFileScatter +! FUNCTION: ReadProcessMemory +! FUNCTION: RegisterConsoleIME +! FUNCTION: RegisterConsoleOS2 +! FUNCTION: RegisterConsoleVDM +! FUNCTION: RegisterWaitForInputIdle +! FUNCTION: RegisterWaitForSingleObject +! FUNCTION: RegisterWaitForSingleObjectEx +! FUNCTION: RegisterWowBaseHandlers +! FUNCTION: RegisterWowExec +! FUNCTION: ReleaseActCtx +! FUNCTION: ReleaseMutex +! FUNCTION: ReleaseSemaphore +! FUNCTION: RemoveDirectoryA +! FUNCTION: RemoveDirectoryW +! FUNCTION: RemoveLocalAlternateComputerNameA +! FUNCTION: RemoveLocalAlternateComputerNameW +! FUNCTION: RemoveVectoredExceptionHandler +! FUNCTION: ReplaceFile +! FUNCTION: ReplaceFileA +! FUNCTION: ReplaceFileW +! FUNCTION: RequestDeviceWakeup +! FUNCTION: RequestWakeupLatency +! FUNCTION: ResetEvent +! FUNCTION: ResetWriteWatch +! FUNCTION: RestoreLastError +! FUNCTION: ResumeThread +! FUNCTION: RtlCaptureContext +! FUNCTION: RtlCaptureStackBackTrace +! FUNCTION: RtlFillMemory +! FUNCTION: RtlMoveMemory +! FUNCTION: RtlUnwind +! FUNCTION: RtlZeroMemory +! FUNCTION: ScrollConsoleScreenBufferA +! FUNCTION: ScrollConsoleScreenBufferW +! FUNCTION: SearchPathA +! FUNCTION: SearchPathW +! FUNCTION: SetCalendarInfoA +! FUNCTION: SetCalendarInfoW +! FUNCTION: SetClientTimeZoneInformation +! FUNCTION: SetCommBreak +! FUNCTION: SetCommConfig +! FUNCTION: SetCommMask +! FUNCTION: SetCommState +! FUNCTION: SetCommTimeouts +! FUNCTION: SetComPlusPackageInstallStatus +! FUNCTION: SetComputerNameA +! FUNCTION: SetComputerNameExA +! FUNCTION: SetComputerNameExW +! FUNCTION: SetComputerNameW +! FUNCTION: SetConsoleActiveScreenBuffer +! FUNCTION: SetConsoleCommandHistoryMode +! FUNCTION: SetConsoleCP +! FUNCTION: SetConsoleCtrlHandler +! FUNCTION: SetConsoleCursor +! FUNCTION: SetConsoleCursorInfo +! FUNCTION: SetConsoleCursorMode +! FUNCTION: SetConsoleCursorPosition +! FUNCTION: SetConsoleDisplayMode +! FUNCTION: SetConsoleFont +! FUNCTION: SetConsoleHardwareState +! FUNCTION: SetConsoleIcon +! FUNCTION: SetConsoleInputExeNameA +! FUNCTION: SetConsoleInputExeNameW +! FUNCTION: SetConsoleKeyShortcuts +! FUNCTION: SetConsoleLocalEUDC +! FUNCTION: SetConsoleMaximumWindowSize +! FUNCTION: SetConsoleMenuClose +! FUNCTION: SetConsoleMode +! FUNCTION: SetConsoleNlsMode +! FUNCTION: SetConsoleNumberOfCommandsA +! FUNCTION: SetConsoleNumberOfCommandsW +! FUNCTION: SetConsoleOS2OemFormat +! FUNCTION: SetConsoleOutputCP +! FUNCTION: SetConsolePalette +! FUNCTION: SetConsoleScreenBufferSize +! FUNCTION: SetConsoleTextAttribute +! FUNCTION: SetConsoleTitleA +! FUNCTION: SetConsoleTitleW +! FUNCTION: SetConsoleWindowInfo +! FUNCTION: SetCPGlobal +! FUNCTION: SetCriticalSectionSpinCount +! FUNCTION: SetCurrentDirectoryA +! FUNCTION: SetCurrentDirectoryW +! FUNCTION: SetDefaultCommConfigA +! FUNCTION: SetDefaultCommConfigW +! FUNCTION: SetDllDirectoryA +! FUNCTION: SetDllDirectoryW +! FUNCTION: SetEndOfFile +! FUNCTION: SetEnvironmentVariableA +! FUNCTION: SetEnvironmentVariableW +! FUNCTION: SetErrorMode +! FUNCTION: SetEvent +! FUNCTION: SetFileApisToANSI +! FUNCTION: SetFileApisToOEM +! FUNCTION: SetFileAttributesA +! FUNCTION: SetFileAttributesW +! FUNCTION: SetFilePointer +! FUNCTION: SetFilePointerEx +! FUNCTION: SetFileShortNameA +! FUNCTION: SetFileShortNameW +! FUNCTION: SetFileTime +! FUNCTION: SetFileValidData +! FUNCTION: SetFirmwareEnvironmentVariableA +! FUNCTION: SetFirmwareEnvironmentVariableW +! FUNCTION: SetHandleContext +! FUNCTION: SetHandleCount +! FUNCTION: SetHandleInformation +! FUNCTION: SetInformationJobObject +! FUNCTION: SetLastConsoleEventActive +! FUNCTION: SetLastError +! FUNCTION: SetLocaleInfoA +! FUNCTION: SetLocaleInfoW +! FUNCTION: SetLocalPrimaryComputerNameA +! FUNCTION: SetLocalPrimaryComputerNameW +! FUNCTION: SetLocalTime +! FUNCTION: SetMailslotInfo +! FUNCTION: SetMessageWaitingIndicator +! FUNCTION: SetNamedPipeHandleState +! FUNCTION: SetPriorityClass +! FUNCTION: SetProcessAffinityMask +! FUNCTION: SetProcessPriorityBoost +! FUNCTION: SetProcessShutdownParameters +! FUNCTION: SetProcessWorkingSetSize +! FUNCTION: SetStdHandle +! FUNCTION: SetSystemPowerState +! FUNCTION: SetSystemTime +! FUNCTION: SetSystemTimeAdjustment +! FUNCTION: SetTapeParameters +! FUNCTION: SetTapePosition +! FUNCTION: SetTermsrvAppInstallMode +! FUNCTION: SetThreadAffinityMask +! FUNCTION: SetThreadContext +! FUNCTION: SetThreadExecutionState +! FUNCTION: SetThreadIdealProcessor +! FUNCTION: SetThreadLocale +! FUNCTION: SetThreadPriority +! FUNCTION: SetThreadPriorityBoost +! FUNCTION: SetThreadUILanguage +! FUNCTION: SetTimerQueueTimer +! FUNCTION: SetTimeZoneInformation +! FUNCTION: SetUnhandledExceptionFilter +! FUNCTION: SetupComm +! FUNCTION: SetUserGeoID +! FUNCTION: SetVDMCurrentDirectories +! FUNCTION: SetVolumeLabelA +! FUNCTION: SetVolumeLabelW +! FUNCTION: SetVolumeMountPointA +! FUNCTION: SetVolumeMountPointW +! FUNCTION: SetWaitableTimer +! FUNCTION: ShowConsoleCursor +! FUNCTION: SignalObjectAndWait +! FUNCTION: SizeofResource +! FUNCTION: Sleep +FUNCTION: DWORD SleepEx ( DWORD dwMilliSeconds, BOOL bAlertable ) ; +! FUNCTION: SuspendThread +! FUNCTION: SwitchToFiber +! FUNCTION: SwitchToThread +! FUNCTION: SystemTimeToFileTime +! FUNCTION: SystemTimeToTzSpecificLocalTime +! FUNCTION: TerminateJobObject +! FUNCTION: TerminateProcess +! FUNCTION: TerminateThread +! FUNCTION: TermsrvAppInstallMode +! FUNCTION: Thread32First +! FUNCTION: Thread32Next +! FUNCTION: TlsAlloc +! FUNCTION: TlsFree +! FUNCTION: TlsGetValue +! FUNCTION: TlsSetValue +! FUNCTION: Toolhelp32ReadProcessMemory +! FUNCTION: TransactNamedPipe +! FUNCTION: TransmitCommChar +! FUNCTION: TrimVirtualBuffer +! FUNCTION: TryEnterCriticalSection +! FUNCTION: TzSpecificLocalTimeToSystemTime +! FUNCTION: UnhandledExceptionFilter +! FUNCTION: UnlockFile +! FUNCTION: UnlockFileEx +! FUNCTION: UnmapViewOfFile +! FUNCTION: UnregisterConsoleIME +! FUNCTION: UnregisterWait +! FUNCTION: UnregisterWaitEx +! FUNCTION: UpdateResourceA +! FUNCTION: UpdateResourceW +! FUNCTION: UTRegister +! FUNCTION: UTUnRegister +! FUNCTION: ValidateLCType +! FUNCTION: ValidateLocale +! FUNCTION: VDMConsoleOperation +! FUNCTION: VDMOperationStarted +! FUNCTION: VerifyConsoleIoHandle +! FUNCTION: VerifyVersionInfoA +! FUNCTION: VerifyVersionInfoW +! FUNCTION: VerLanguageNameA +! FUNCTION: VerLanguageNameW +! FUNCTION: VerSetConditionMask +! FUNCTION: VirtualAlloc +! FUNCTION: VirtualAllocEx +! FUNCTION: VirtualBufferExceptionHandler +! FUNCTION: VirtualFree +! FUNCTION: VirtualFreeEx +! FUNCTION: VirtualLock +! FUNCTION: VirtualProtect +! FUNCTION: VirtualProtectEx +! FUNCTION: VirtualQuery +! FUNCTION: VirtualQueryEx +! FUNCTION: VirtualUnlock +! FUNCTION: WaitCommEvent +! FUNCTION: WaitForDebugEvent +! FUNCTION: WaitForMultipleObjects +! FUNCTION: WaitForMultipleObjectsEx +! FUNCTION: WaitForSingleObject +! FUNCTION: WaitForSingleObjectEx +! FUNCTION: WaitNamedPipeA +! FUNCTION: WaitNamedPipeW +! FUNCTION: WideCharToMultiByte +! FUNCTION: WinExec +! FUNCTION: WriteConsoleA +! FUNCTION: WriteConsoleInputA +! FUNCTION: WriteConsoleInputVDMA +! FUNCTION: WriteConsoleInputVDMW +! FUNCTION: WriteConsoleInputW +! FUNCTION: WriteConsoleOutputA +! FUNCTION: WriteConsoleOutputAttribute +! FUNCTION: WriteConsoleOutputCharacterA +! FUNCTION: WriteConsoleOutputCharacterW +! FUNCTION: WriteConsoleOutputW +! FUNCTION: WriteConsoleW +! FUNCTION: WriteFile +! FUNCTION: WriteFileEx +! FUNCTION: WriteFileGather +! FUNCTION: WritePrivateProfileSectionA +! FUNCTION: WritePrivateProfileSectionW +! FUNCTION: WritePrivateProfileStringA +! FUNCTION: WritePrivateProfileStringW +! FUNCTION: WritePrivateProfileStructA +! FUNCTION: WritePrivateProfileStructW +! FUNCTION: WriteProcessMemory +! FUNCTION: WriteProfileSectionA +! FUNCTION: WriteProfileSectionW +! FUNCTION: WriteProfileStringA +! FUNCTION: WriteProfileStringW +! FUNCTION: WriteTapemark +! FUNCTION: WTSGetActiveConsoleSessionId +! FUNCTION: ZombifyActCtx diff --git a/library/windows/load.factor b/library/windows/load.factor index 67af88ce8f..931f7afd14 100644 --- a/library/windows/load.factor +++ b/library/windows/load.factor @@ -1,30 +1,31 @@ -IN: scratchpad -USING: alien compiler kernel namespaces parser sequences words ; - -{ - { "gdi32" "gdi32.dll" "stdcall" } - { "user32" "user32.dll" "stdcall" } - { "kernel32" "kernel32.dll" "stdcall" } - { "winsock" "ws2_32.dll" "stdcall" } - { "mswsock" "mswsock.dll" "stdcall" } - { "libc" "msvcrt.dll" "cdecl" } -} [ first3 add-library ] each - -{ - "windows-messages" - "types" - "gdi32" - "kernel32-types" - "kernel32-constants" - "kernel32-structs" - "kernel32" - "user32-types" - "user32-constants" - "user32-structs" - "user32" - "opengl32" - "utils" -} [ "/windows/" swap ".factor" append3 run-resource ] each - -IN: kernel -: default-shell "tty" ; +IN: scratchpad +USING: alien compiler kernel namespaces parser sequences words ; + +{ + { "gdi32" "gdi32.dll" "stdcall" } + { "user32" "user32.dll" "stdcall" } + { "kernel32" "kernel32.dll" "stdcall" } + { "winsock" "ws2_32.dll" "stdcall" } + { "mswsock" "mswsock.dll" "stdcall" } + { "libc" "msvcrt.dll" "cdecl" } +} [ first3 add-library ] each + +{ + "windows-messages" + "types" + "gdi32-constants" + "gdi32" + "kernel32-constants" + "kernel32-structs" + "kernel32-types" + "kernel32" + "user32-constants" + "user32-structs" + "user32-types" + "user32" + "opengl32" + "utils" +} [ "/library/windows/" swap ".factor" append3 run-resource ] each + +IN: kernel +: default-shell "tty" ; diff --git a/library/windows/types.factor b/library/windows/types.factor index c52a85afc5..9887481ff4 100644 --- a/library/windows/types.factor +++ b/library/windows/types.factor @@ -249,16 +249,17 @@ TYPEDEF: HANDLE SERVICE_STATUS_HANDLE TYPEDEF: ULONG_PTR SIZE_T TYPEDEF: LONG_PTR SSIZE_T TYPEDEF: LONGLONG USN +! TYPEDEF: __stdcall WINAPI TYPEDEF: UINT_PTR WPARAM + + TYPEDEF: RECT* LPRECT TYPEDEF: void* PWNDCLASS TYPEDEF: void* PWNDCLASSEX TYPEDEF: void* WNDPROC -TYPEDEF: void* MSGBOXPARAMSA -TYPEDEF: void* MSGBOXPARAMSW ! typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM); diff --git a/library/windows/user32.factor b/library/windows/user32.factor index 7d6545dfef..4e60166c7b 100644 --- a/library/windows/user32.factor +++ b/library/windows/user32.factor @@ -4,6 +4,486 @@ USING: alien parser namespaces kernel syntax words math io prettyprint ; IN: win32-api +TYPEDEF: void* MSGBOXPARAMSA +TYPEDEF: void* MSGBOXPARAMSW + + +! HKL for ActivateKeyboardLayout +: HKL_PREV 0 ; +: HKL_NEXT 1 ; + +: CW_USEDEFAULT HEX: 80000000 ; + +: WS_OVERLAPPED HEX: 00000000 ; +: WS_POPUP HEX: 80000000 ; +: WS_CHILD HEX: 40000000 ; +: WS_MINIMIZE HEX: 20000000 ; +: WS_VISIBLE HEX: 10000000 ; +: WS_DISABLED HEX: 08000000 ; +: WS_CLIPSIBLINGS HEX: 04000000 ; +: WS_CLIPCHILDREN HEX: 02000000 ; +: WS_MAXIMIZE HEX: 01000000 ; +: WS_CAPTION HEX: 00C00000 ; ! /* WS_BORDER | WS_DLGFRAME */ +: WS_BORDER HEX: 00800000 ; +: WS_DLGFRAME HEX: 00400000 ; +: WS_VSCROLL HEX: 00200000 ; +: WS_HSCROLL HEX: 00100000 ; +: WS_SYSMENU HEX: 00080000 ; +: WS_THICKFRAME HEX: 00040000 ; +: WS_GROUP HEX: 00020000 ; +: WS_TABSTOP HEX: 00010000 ; +: WS_MINIMIZEBOX HEX: 00020000 ; +: WS_MAXIMIZEBOX HEX: 00010000 ; + +! Common window styles +: WS_OVERLAPPEDWINDOW WS_OVERLAPPED WS_CAPTION WS_SYSMENU WS_THICKFRAME WS_MINIMIZEBOX WS_MAXIMIZEBOX bitor bitor bitor bitor bitor ; + +: WS_POPUPWINDOW WS_POPUP WS_BORDER WS_SYSMENU bitor bitor ; + +: WS_CHILDWINDOW WS_CHILD ; + +: WS_TILED WS_OVERLAPPED ; +: WS_ICONIC WS_MINIMIZE ; +: WS_SIZEBOX WS_THICKFRAME ; +: WS_TILEDWINDOW WS_OVERLAPPEDWINDOW ; + + + +! Extended window styles + +: WS_EX_DLGMODALFRAME HEX: 00000001 ; inline +: WS_EX_NOPARENTNOTIFY HEX: 00000004 ; inline +: WS_EX_TOPMOST HEX: 00000008 ; inline +: WS_EX_ACCEPTFILES HEX: 00000010 ; inline +: WS_EX_TRANSPARENT HEX: 00000020 ; inline +: WS_EX_MDICHILD HEX: 00000040 ; inline +: WS_EX_TOOLWINDOW HEX: 00000080 ; inline +: WS_EX_WINDOWEDGE HEX: 00000100 ; inline +: WS_EX_CLIENTEDGE HEX: 00000200 ; inline +: WS_EX_CONTEXTHELP HEX: 00000400 ; inline + +: WS_EX_RIGHT HEX: 00001000 ; inline +: WS_EX_LEFT HEX: 00000000 ; inline +: WS_EX_RTLREADING HEX: 00002000 ; inline +: WS_EX_LTRREADING HEX: 00000000 ; inline +: WS_EX_LEFTSCROLLBAR HEX: 00004000 ; inline +: WS_EX_RIGHTSCROLLBAR HEX: 00000000 ; inline +: WS_EX_CONTROLPARENT HEX: 00010000 ; inline +: WS_EX_STATICEDGE HEX: 00020000 ; inline +: WS_EX_APPWINDOW HEX: 00040000 ; inline +: WS_EX_OVERLAPPEDWINDOW WS_EX_WINDOWEDGE WS_EX_CLIENTEDGE bitor ; inline +: WS_EX_PALETTEWINDOW + WS_EX_WINDOWEDGE WS_EX_TOOLWINDOW bitor WS_EX_TOPMOST bitor ; inline + + +: CS_VREDRAW HEX: 0001 ; +: CS_HREDRAW HEX: 0002 ; +: CS_DBLCLKS HEX: 0008 ; +: CS_OWNDC HEX: 0020 ; +: CS_CLASSDC HEX: 0040 ; +: CS_PARENTDC HEX: 0080 ; +: CS_NOCLOSE HEX: 0200 ; +: CS_SAVEBITS HEX: 0800 ; +: CS_BYTEALIGNCLIENT HEX: 1000 ; +: CS_BYTEALIGNWINDOW HEX: 2000 ; +: CS_GLOBALCLASS HEX: 4000 ; + +: COLOR_SCROLLBAR 0 ; +: COLOR_BACKGROUND 1 ; +: COLOR_ACTIVECAPTION 2 ; +: COLOR_INACTIVECAPTION 3 ; +: COLOR_MENU 4 ; +: COLOR_WINDOW 5 ; +: COLOR_WINDOWFRAME 6 ; +: COLOR_MENUTEXT 7 ; +: COLOR_WINDOWTEXT 8 ; +: COLOR_CAPTIONTEXT 9 ; +: COLOR_ACTIVEBORDER 10 ; +: COLOR_INACTIVEBORDER 11 ; +: COLOR_APPWORKSPACE 12 ; +: COLOR_HIGHLIGHT 13 ; +: COLOR_HIGHLIGHTTEXT 14 ; +: COLOR_BTNFACE 15 ; +: COLOR_BTNSHADOW 16 ; +: COLOR_GRAYTEXT 17 ; +: COLOR_BTNTEXT 18 ; +: COLOR_INACTIVECAPTIONTEXT 19 ; +: COLOR_BTNHIGHLIGHT 20 ; + +: IDI_APPLICATION 32512 ; +: IDI_HAND 32513 ; +: IDI_QUESTION 32514 ; +: IDI_EXCLAMATION 32515 ; +: IDI_ASTERISK 32516 ; +: IDI_WINLOGO 32517 ; + +! ShowWindow() Commands +: SW_HIDE 0 ; +: SW_SHOWNORMAL 1 ; +: SW_NORMAL 1 ; +: SW_SHOWMINIMIZED 2 ; +: SW_SHOWMAXIMIZED 3 ; +: SW_MAXIMIZE 3 ; +: SW_SHOWNOACTIVATE 4 ; +: SW_SHOW 5 ; +: SW_MINIMIZE 6 ; +: SW_SHOWMINNOACTIVE 7 ; +: SW_SHOWNA 8 ; +: SW_RESTORE 9 ; +: SW_SHOWDEFAULT 10 ; +: SW_FORCEMINIMIZE 11 ; +: SW_MAX 11 ; + +! PeekMessage +: PM_NOREMOVE 0 ; +: PM_REMOVE 1 ; +: PM_NOYIELD 2 ; +! : PM_QS_INPUT (QS_INPUT << 16) ; +! : PM_QS_POSTMESSAGE ((QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16) ; +! : PM_QS_PAINT (QS_PAINT << 16) ; +! : PM_QS_SENDMESSAGE (QS_SENDMESSAGE << 16) ; + + +! +! Standard Cursor IDs +! +: IDC_ARROW 32512 ; +: IDC_IBEAM 32513 ; +: IDC_WAIT 32514 ; +: IDC_CROSS 32515 ; +: IDC_UPARROW 32516 ; +: IDC_SIZE 32640 ; ! OBSOLETE: use IDC_SIZEALL +: IDC_ICON 32641 ; ! OBSOLETE: use IDC_ARROW +: IDC_SIZENWSE 32642 ; +: IDC_SIZENESW 32643 ; +: IDC_SIZEWE 32644 ; +: IDC_SIZENS 32645 ; +: IDC_SIZEALL 32646 ; +: IDC_NO 32648 ; ! not in win3.1 +: IDC_HAND 32649 ; +: IDC_APPSTARTING 32650 ; ! not in win3.1 +: IDC_HELP 32651 ; + + + + + +! Predefined Clipboard Formats +: CF_TEXT 1 ; inline +: CF_BITMAP 2 ; inline +: CF_METAFILEPICT 3 ; inline +: CF_SYLK 4 ; inline +: CF_DIF 5 ; inline +: CF_TIFF 6 ; inline +: CF_OEMTEXT 7 ; inline +: CF_DIB 8 ; inline +: CF_PALETTE 9 ; inline +: CF_PENDATA 10 ; inline +: CF_RIFF 11 ; inline +: CF_WAVE 12 ; inline +: CF_UNICODETEXT 13 ; inline +: CF_ENHMETAFILE 14 ; inline +: CF_HDROP 15 ; inline +: CF_LOCALE 16 ; inline +: CF_DIBV5 17 ; inline +: CF_MAX 18 ; inline + +: CF_OWNERDISPLAY HEX: 0080 ; inline +: CF_DSPTEXT HEX: 0081 ; inline +: CF_DSPBITMAP HEX: 0082 ; inline +: CF_DSPMETAFILEPICT HEX: 0083 ; inline +: CF_DSPENHMETAFILE HEX: 008E ; inline + +! "Private" formats don't get GlobalFree()'d +: CF_PRIVATEFIRST HEX: 200 ; inline +: CF_PRIVATELAST HEX: 2FF ; inline + + + + + +! "GDIOBJ" formats do get DeleteObject()'d +: CF_GDIOBJFIRST HEX: 300 ; inline +: CF_GDIOBJLAST HEX: 3FF ; inline + + +: WM_NULL 0 ; inline +: WM_CREATE 1 ; inline +: WM_DESTROY 2 ; inline +: WM_MOVE 3 ; inline +: WM_SIZE 5 ; inline +: WM_ACTIVATE 6 ; inline + + +! Virtual Keys, Standard Set +: VK_LBUTTON HEX: 01 ; inline +: VK_RBUTTON HEX: 02 ; inline +: VK_CANCEL HEX: 03 ; inline +: VK_MBUTTON HEX: 04 ; inline ! NOT contiguous with L & RBUTTON +: VK_XBUTTON1 HEX: 05 ; inline ! NOT contiguous with L & RBUTTON +: VK_XBUTTON2 HEX: 06 ; inline ! NOT contiguous with L & RBUTTON +! 0x07 : unassigned +: VK_BACK HEX: 08 ; inline +: VK_TAB HEX: 09 ; inline +! 0x0A - 0x0B : reserved + +: VK_CLEAR HEX: 0C ; inline +: VK_RETURN HEX: 0D ; inline + +: VK_SHIFT HEX: 10 ; inline +: VK_CONTROL HEX: 11 ; inline +: VK_MENU HEX: 12 ; inline +: VK_PAUSE HEX: 13 ; inline +: VK_CAPITAL HEX: 14 ; inline + +: VK_KANA HEX: 15 ; inline +: VK_HANGEUL HEX: 15 ; inline ! old name - here for compatibility +: VK_HANGUL HEX: 15 ; inline +: VK_JUNJA HEX: 17 ; inline +: VK_FINAL HEX: 18 ; inline +: VK_HANJA HEX: 19 ; inline +: VK_KANJI HEX: 19 ; inline + +: VK_ESCAPE HEX: 1B ; inline + +: VK_CONVERT HEX: 1C ; inline +: VK_NONCONVERT HEX: 1D ; inline +: VK_ACCEPT HEX: 1E ; inline +: VK_MODECHANGE HEX: 1F ; inline + +: VK_SPACE HEX: 20 ; inline +: VK_PRIOR HEX: 21 ; inline +: VK_NEXT HEX: 22 ; inline +: VK_END HEX: 23 ; inline +: VK_HOME HEX: 24 ; inline +: VK_LEFT HEX: 25 ; inline +: VK_UP HEX: 26 ; inline +: VK_RIGHT HEX: 27 ; inline +: VK_DOWN HEX: 28 ; inline +: VK_SELECT HEX: 29 ; inline +: VK_PRINT HEX: 2A ; inline +: VK_EXECUTE HEX: 2B ; inline +: VK_SNAPSHOT HEX: 2C ; inline +: VK_INSERT HEX: 2D ; inline +: VK_DELETE HEX: 2E ; inline +: VK_HELP HEX: 2F ; inline + +! VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39) +! 0x40 : unassigned +! VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) + +: VK_LWIN HEX: 5B ; inline +: VK_RWIN HEX: 5C ; inline +: VK_APPS HEX: 5D ; inline + +! 0x5E : reserved + +: VK_SLEEP HEX: 5F ; inline + +: VK_NUMPAD0 HEX: 60 ; inline +: VK_NUMPAD1 HEX: 61 ; inline +: VK_NUMPAD2 HEX: 62 ; inline +: VK_NUMPAD3 HEX: 63 ; inline +: VK_NUMPAD4 HEX: 64 ; inline +: VK_NUMPAD5 HEX: 65 ; inline +: VK_NUMPAD6 HEX: 66 ; inline +: VK_NUMPAD7 HEX: 67 ; inline +: VK_NUMPAD8 HEX: 68 ; inline +: VK_NUMPAD9 HEX: 69 ; inline +: VK_MULTIPLY HEX: 6A ; inline +: VK_ADD HEX: 6B ; inline +: VK_SEPARATOR HEX: 6C ; inline +: VK_SUBTRACT HEX: 6D ; inline +: VK_DECIMAL HEX: 6E ; inline +: VK_DIVIDE HEX: 6F ; inline +: VK_F1 HEX: 70 ; inline +: VK_F2 HEX: 71 ; inline +: VK_F3 HEX: 72 ; inline +: VK_F4 HEX: 73 ; inline +: VK_F5 HEX: 74 ; inline +: VK_F6 HEX: 75 ; inline +: VK_F7 HEX: 76 ; inline +: VK_F8 HEX: 77 ; inline +: VK_F9 HEX: 78 ; inline +: VK_F10 HEX: 79 ; inline +: VK_F11 HEX: 7A ; inline +: VK_F12 HEX: 7B ; inline +: VK_F13 HEX: 7C ; inline +: VK_F14 HEX: 7D ; inline +: VK_F15 HEX: 7E ; inline +: VK_F16 HEX: 7F ; inline +: VK_F17 HEX: 80 ; inline +: VK_F18 HEX: 81 ; inline +: VK_F19 HEX: 82 ; inline +: VK_F20 HEX: 83 ; inline +: VK_F21 HEX: 84 ; inline +: VK_F22 HEX: 85 ; inline +: VK_F23 HEX: 86 ; inline +: VK_F24 HEX: 87 ; inline + +! 0x88 - 0x8F : unassigned + +: VK_NUMLOCK HEX: 90 ; inline +: VK_SCROLL HEX: 91 ; inline + +! NEC PC-9800 kbd definitions +: VK_OEM_NEC_EQUAL HEX: 92 ; inline ! '=' key on numpad + +! Fujitsu/OASYS kbd definitions +: VK_OEM_FJ_JISHO HEX: 92 ; inline ! 'Dictionary' key +: VK_OEM_FJ_MASSHOU HEX: 93 ; inline ! 'Unregister word' key +: VK_OEM_FJ_TOUROKU HEX: 94 ; inline ! 'Register word' key +: VK_OEM_FJ_LOYA HEX: 95 ; inline ! 'Left OYAYUBI' key +: VK_OEM_FJ_ROYA HEX: 96 ; inline ! 'Right OYAYUBI' key + +! 0x97 - 0x9F : unassigned + +! VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys. +! Used only as parameters to GetAsyncKeyState() and GetKeyState(). +! No other API or message will distinguish left and right keys in this way. +: VK_LSHIFT HEX: A0 ; inline +: VK_RSHIFT HEX: A1 ; inline +: VK_LCONTROL HEX: A2 ; inline +: VK_RCONTROL HEX: A3 ; inline +: VK_LMENU HEX: A4 ; inline +: VK_RMENU HEX: A5 ; inline + +: VK_BROWSER_BACK HEX: A6 ; inline +: VK_BROWSER_FORWARD HEX: A7 ; inline +: VK_BROWSER_REFRESH HEX: A8 ; inline +: VK_BROWSER_STOP HEX: A9 ; inline +: VK_BROWSER_SEARCH HEX: AA ; inline +: VK_BROWSER_FAVORITES HEX: AB ; inline +: VK_BROWSER_HOME HEX: AC ; inline + +: VK_VOLUME_MUTE HEX: AD ; inline +: VK_VOLUME_DOWN HEX: AE ; inline +: VK_VOLUME_UP HEX: AF ; inline +: VK_MEDIA_NEXT_TRACK HEX: B0 ; inline +: VK_MEDIA_PREV_TRACK HEX: B1 ; inline +: VK_MEDIA_STOP HEX: B2 ; inline +: VK_MEDIA_PLAY_PAUSE HEX: B3 ; inline +: VK_LAUNCH_MAIL HEX: B4 ; inline +: VK_LAUNCH_MEDIA_SELECT HEX: B5 ; inline +: VK_LAUNCH_APP1 HEX: B6 ; inline +: VK_LAUNCH_APP2 HEX: B7 ; inline + +! 0xB8 - 0xB9 : reserved + +: VK_OEM_1 HEX: BA ; inline ! ';:' for US +: VK_OEM_PLUS HEX: BB ; inline ! '+' any country +: VK_OEM_COMMA HEX: BC ; inline ! ',' any country +: VK_OEM_MINUS HEX: BD ; inline ! '-' any country +: VK_OEM_PERIOD HEX: BE ; inline ! '.' any country +: VK_OEM_2 HEX: BF ; inline ! '/?' for US +: VK_OEM_3 HEX: C0 ; inline ! '`~' for US + +! 0xC1 - 0xD7 : reserved + +! 0xD8 - 0xDA : unassigned + +: VK_OEM_4 HEX: DB ; inline ! '[{' for US +: VK_OEM_5 HEX: DC ; inline ! '\|' for US +: VK_OEM_6 HEX: DD ; inline ! ']}' for US +: VK_OEM_7 HEX: DE ; inline ! ''"' for US +: VK_OEM_8 HEX: DF ; inline + +! 0xE0 : reserved + +! Various extended or enhanced keyboards +: VK_OEM_AX HEX: E1 ; inline ! 'AX' key on Japanese AX kbd +: VK_OEM_102 HEX: E2 ; inline ! "<>" or "\|" on RT 102-key kbd. +: VK_ICO_HELP HEX: E3 ; inline ! Help key on ICO +: VK_ICO_00 HEX: E4 ; inline ! 00 key on ICO + +: VK_PROCESSKEY HEX: E5 ; inline + +: VK_ICO_CLEAR HEX: E6 ; inline + +: VK_PACKET HEX: E7 ; inline + +! 0xE8 : unassigned + +! Nokia/Ericsson definitions +: VK_OEM_RESET HEX: E9 ; inline +: VK_OEM_JUMP HEX: EA ; inline +: VK_OEM_PA1 HEX: EB ; inline +: VK_OEM_PA2 HEX: EC ; inline +: VK_OEM_PA3 HEX: ED ; inline +: VK_OEM_WSCTRL HEX: EE ; inline +: VK_OEM_CUSEL HEX: EF ; inline +: VK_OEM_ATTN HEX: F0 ; inline +: VK_OEM_FINISH HEX: F1 ; inline +: VK_OEM_COPY HEX: F2 ; inline +: VK_OEM_AUTO HEX: F3 ; inline +: VK_OEM_ENLW HEX: F4 ; inline +: VK_OEM_BACKTAB HEX: F5 ; inline + +: VK_ATTN HEX: F6 ; inline +: VK_CRSEL HEX: F7 ; inline +: VK_EXSEL HEX: F8 ; inline +: VK_EREOF HEX: F9 ; inline +: VK_PLAY HEX: FA ; inline +: VK_ZOOM HEX: FB ; inline +: VK_NONAME HEX: FC ; inline +: VK_PA1 HEX: FD ; inline +: VK_OEM_CLEAR HEX: FE ; inline +! 0xFF : reserved + +! Key State Masks for Mouse Messages +: MK_LBUTTON HEX: 0001 ; inline +: MK_RBUTTON HEX: 0002 ; inline +: MK_SHIFT HEX: 0004 ; inline +: MK_CONTROL HEX: 0008 ; inline +: MK_MBUTTON HEX: 0010 ; inline +: MK_XBUTTON1 HEX: 0020 ; inline +: MK_XBUTTON2 HEX: 0040 ; inline + + +! Some fields are not defined for win64 +! Window field offsets for GetWindowLong() +! TODO: win32 only!! +windows? [ + : GWL_WNDPROC -4 ; + : GWL_HINSTANCE -6 ; + : GWL_HWNDPARENT -8 ; + : GWL_USERDATA -21 ; + : GWL_ID -12 ; +] when + +: GWL_STYLE -16 ; +: GWL_EXSTYLE -20 ; + +: GWLP_WNDPROC -4 ; +: GWLP_HINSTANCE -6 ; +: GWLP_HWNDPARENT -8 ; +: GWLP_USERDATA -21 ; +: GWLP_ID -12 ; + +! Class field offsets for GetClassLong() +! TODO: win32 only! +windows? [ + : GCL_MENUNAME -8 ; + : GCL_HBRBACKGROUND -10 ; + : GCL_HCURSOR -12 ; + : GCL_HICON -14 ; + : GCL_HMODULE -16 ; + : GCL_WNDPROC -24 ; + : GCL_HICONSM -34 ; +] when +: GCL_CBWNDEXTRA -18 ; +: GCL_CBCLSEXTRA -20 ; +: GCL_STYLE -26 ; +: GCW_ATOM -32 ; + +: GCLP_MENUNAME -8 ; +: GCLP_HBRBACKGROUND -10 ; +: GCLP_HCURSOR -12 ; +: GCLP_HICON -14 ; +: GCLP_HMODULE -16 ; +: GCLP_WNDPROC -24 ; +: GCLP_HICONSM -34 ; + LIBRARY: user32 @@ -559,6 +1039,12 @@ FUNCTION: HICON LoadIconW ( HINSTANCE hInstance, ushort lpIconName ) ; ! FUNCTION: MenuWindowProcA ! FUNCTION: MenuWindowProcW + +: MB_ICONASTERISK HEX: 00000040 ; +: MB_ICONEXCLAMATION HEX: 00000030 ; +: MB_ICONHAND HEX: 00000010 ; +: MB_ICONQUESTION HEX: 00000020 ; +: MB_OK HEX: 00000000 ; ! -1 is Simple beep FUNCTION: BOOL MessageBeep ( UINT uType ) ; diff --git a/library/windows/utils.factor b/library/windows/utils.factor index ee878f4b26..fbc63ed968 100644 --- a/library/windows/utils.factor +++ b/library/windows/utils.factor @@ -1,8 +1,14 @@ ! Copyright (C) 2005, 2006 Doug Coleman. ! See http://factor.sf.net/license.txt for BSD license. -USING: alien parser namespaces kernel syntax words math io prettyprint ; +USING: alien errors io kernel math namespaces parser prettyprint words ; IN: win32-api +: (win32-error) ( id -- string ) + #! In f.exe + "char*" f "error_message" [ "int" ] alien-invoke ; + +: win32-error ( -- ) GetLastError dup 0 = [ (win32-error) throw ] unless drop ; + : win32-error=0 zero? [ win32-error ] when ; : win32-error>0 0 > [ win32-error ] when ; : win32-error<0 0 < [ win32-error ] when ; diff --git a/library/windows/windows-messages.factor b/library/windows/windows-messages.factor index 2ceee656dd..cd20ec6af0 100644 --- a/library/windows/windows-messages.factor +++ b/library/windows/windows-messages.factor @@ -4,12 +4,16 @@ USING: hashtables kernel math namespaces parser prettyprint words ; IN: win32-api-messages SYMBOL: windows-messages -H{ } clone windows-messaage set-global USE: inspector +: maybe-create-windows-messages + windows-messages get hashtable? + [ H{ } clone global [ windows-messages set ] bind ] unless ; + : add-windows-message ( -- ) - word [ unparse ] keep execute windows-messages get set-hash ; parsing + word [ unparse ] keep execute maybe-create-windows-messages + windows-messages get set-hash ; parsing : get-windows-message-name ( n -- name ) windows-messages get hash* [ drop "unknown message" ] unless ;