Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.
--- a/kernel/eka/CMakeLists.txt Wed Dec 02 23:38:08 2009 +0100
+++ b/kernel/eka/CMakeLists.txt Tue Dec 08 08:11:42 2009 +0100
@@ -14,10 +14,13 @@
cmake_minimum_required(VERSION 2.6)
#add_definitions(-DUNICODE)
-add_definitions(-D__CPU_X86)
add_definitions(-D__VC32__)
add_definitions(-D_UNICODE)
add_definitions(-D__LEAVE_EQUALS_THROW__)
+add_definitions(-D__WINS__)
+#__CPU_X86 is declared by __WINS__
+#add_definitions(-D__CPU_X86)
+add_definitions(-D__DLL__)
include_directories (./euser ./euser/unicode ./include)
@@ -50,6 +53,12 @@
${sourcepath}mem.cpp ${sourcepath}secure.cpp
)
+#Adding the sources from common/win32
+set (sourcepath ./common/win32/)
+set (source ${source}
+${sourcepath}atomics.cpp
+)
+
#Adding the sources from maths
set (sourcepath ./euser/maths/)
set (source ${source}
@@ -80,8 +89,26 @@
)
#define our library
-add_library (euser SHARED ${source} )
+add_library (emulator SHARED ./euser/epoc/win32/emulator.cpp)
+target_link_libraries(emulator kernel32)
+
+add_library (euser SHARED ${source})
+target_link_libraries(euser emulator)
+
+add_library (estub ./euser/epoc/win32/uc_stub.cpp)
+
+add_executable(epoc ./euser/epoc/win32/uc_epoc.cpp)
+target_link_libraries(epoc estub euser)
+
+
+
+
+
+
#define vs IDE folders
source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$")
source_group(Includes REGULAR_EXPRESSION ".+\\.h$")
+
+#TODO: generate the exec enum
+#perl genexec.pl -i execs.txt -e ../include/exec_enum.h -u ../include/exec_user.h -k ../include/exec_kernel.h
--- a/kernel/eka/euser/epoc/win32/emulator.cpp Wed Dec 02 23:38:08 2009 +0100
+++ b/kernel/eka/euser/epoc/win32/emulator.cpp Tue Dec 08 08:11:42 2009 +0100
@@ -783,7 +783,7 @@
EXPORT_C TInt Emulator::RImageFile::Open(LPCTSTR aImageFile)
{
Buf8<MAX_PATH> nameBuf(aImageFile);
- char *pName = strrchr(LPCSTR(nameBuf), '\\');
+ char *pName = (char *)strrchr(LPCSTR(nameBuf), '\\');
pName ? ++pName : pName = (char *)LPCSTR(nameBuf);
__LOCK_HOST;