Skip to content

Commit

Permalink
[DLL] Function stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
PeyTy committed Feb 1, 2024
1 parent 7a8bae7 commit 0b39b3e
Show file tree
Hide file tree
Showing 7 changed files with 387 additions and 13 deletions.
33 changes: 30 additions & 3 deletions dlls/advapi32.dll/advapi32.hexa
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The Tofita Kernel
// Copyright (C) 2022-2023 Oleh Petrenko
// Copyright (C) 2022-2024 Oleh Petrenko
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -13,8 +13,35 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

@dllExport('advapi32stub')
fun stub() {}
@dllExport('RegCloseKey')
fun regCloseKey(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@dllExport('RegCreateKeyExW')
fun regCreateKeyExW(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@dllExport('RegOpenKeyExW')
fun regOpenKeyExW(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@dllExport('RegQueryValueExW')
fun regQueryValueExW(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@dllExport('RegSetValueExW')
fun regSetValueExW(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@linkName('_DllMainCRTStartup_TODO')
#if bit32
Expand Down
7 changes: 5 additions & 2 deletions dlls/comctl32.dll/comctl32.hexa
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

@dllExport('comctl32stub')
fun stub() {}
@dllExport('InitCommonControls')
fun initCommonControls(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@linkName('_DllMainCRTStartup_TODO')
#if bit32
Expand Down
27 changes: 24 additions & 3 deletions dlls/gdi32.dll/gdi32.hexa
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The Tofita Kernel
// Copyright (C) 2022-2023 Oleh Petrenko
// Copyright (C) 2022-2024 Oleh Petrenko
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -13,8 +13,29 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

@dllExport('gdi32stub')
fun stub() {}
@dllExport('GetStockObject')
fun getStockObject(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@dllExport('GetTextExtentPoint32W')
fun getTextExtentPoint32W(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@dllExport('SetBkMode')
fun setBkMode(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@dllExport('SetTextColor')
fun setTextColor(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@linkName('_DllMainCRTStartup_TODO')
#if bit32
Expand Down
4 changes: 3 additions & 1 deletion dlls/kernel32.dll/kernel32.hexa
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The Tofita Kernel
// Copyright (C) 2022-2023 Oleh Petrenko
// Copyright (C) 2022-2024 Oleh Petrenko
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -36,6 +36,7 @@ fun localAlloc(flags UInt32, bytes SizeOfPointer) HLocal {
bufferOffset++
// TODO non-loop align
}

return result as! HLocal
}

Expand All @@ -52,6 +53,7 @@ fun heapAlloc(heap Handle, flags UInt32, bytes SizeOfPointer) ArrayPointer<UInt8
return localAlloc(0, bytes) as! ArrayPointer<UInt8>
}

// TODO move to crt
@dllExport('free')
fun free(@hide pointer SizeOfPointer) Void {
// TODO
Expand Down
7 changes: 5 additions & 2 deletions dlls/shell32.dll/shell32.hexa
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

@dllExport('shell32stub')
fun stub() {}
@dllExport('ShellAboutW')
fun shellAboutW(stub SizeOfPointer) SizeOfPointer {
// TODO
return 0
}

@linkName('_DllMainCRTStartup_TODO')
#if bit32
Expand Down
Loading

0 comments on commit 0b39b3e

Please sign in to comment.