Code Monkey home page Code Monkey logo

wcecl's People

Contributors

dz333n avatar thennx avatar veselcraft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wcecl's Issues

Resort exports.def

It'd be better to resort exports.def. Example:

...

; winuser_wcecl.cpp
LoadIconW=LoadIconW_WCECL     @510
LoadBitmapW=LoadBitmapW_WCECL @511

; imm_wcecl.cpp
ImmThing  @1 
ImmUse    @42

; strsafe_wcecl.cpp
StringCchCopyW=StringCchCopyW_WCECL         @1689
StringCchPrintfExW=StringCchPrintfExW_WCECL @1701
StringCchPrintfW=StringCchPrintfW_WCECL     @1699
StringCbPrintfW=StringCbPrintfW_WCECL       @1700
StringCchCopyExW=StringCchCopyExW_WCECL     @1691
StringCchVPrintfW=StringCchVPrintfW_WCECL   @1697

...

Windows does not pass arguments to the entrypoint directly

In Win32 applications, the entrypoint present in PE headers and invoked on program start does not have any parameters. Functions like WinMain are not the real entrypoint of the program - instead, a function (usually provided by the compiler) like WinMainCRTStartup is used to get things like command line arguments, initialise the C/C++ runtime, and to call the "higher-level entrypoint".

Judging by function names, programs compiled for WinCE seem to have a CRT startup routines, but they expect the arguments from the operating system. Because no arguments are provided by the OS, the program, for example, has no access to the command line arguments.

Compare stack traces with debug symbols between a Win32 application, and a WinCE one:

Win32:
obraz
WinCE (not showing anything above that in that stacktrace, as it seems that at least for solitaire.exe, CRT startup function is the only entrypoint - the main program loop is there):
obraz

Using a dirty hack that violates many best practices to call the entrypoint from COREDLL!DllMain, implementing some functions, clicking through a few stub messages, and making some other minor tweaks, it is possible to run WinCE cmd.exe, albeit it doesn't really work that great.
obraz

Exception handling

Currently it shows only this window and nothing about useful information
image

(related to #4)

[PROBLEMS] Command Line CE

Actual probelms:

  • Function _getstdfilex_WCECL is not implemented yet.
  • Function WaitForAPIReady is not implemented yet.
  • Function GetStdioPath is not implemented yet.
  • Fails with runtime assert
    image

Non standard assertions

The provided AssertXXX macros seem to be written in a non-standard way - for some reason, they trigger when asserted expressions are true, instead of triggering on false. This is quite confusing, and caused me some debugging, that could be avoided if:

  • The macros were renamed to differentiate their behaviour from normal assertions
  • The macros were changed to behave in a more standard way

[PROBLEMS] Solitare CE

Actual problems:

  • nCmdShow is wrong and causes ShowWindow to show window wrong or not show at all.
  • Exception after closing main window. (usually wrong coredll declarations)

Fixed:

  • Wrong Score and Time number - fixed in 480d60b
  • GUI is broken a little bit - fixed in 14ec213
  • Random is broken and generates wrong cards - fixed in #11 2533081
  • CreateWindowEx generating exception in user32.dll - fixed in 027d266 171fa5b
  • RegisterClass fails - fixed in e3ae04e
  • LoadBitmap fails - fixed in e3ae04e
  • LoadString fails - fixed in e3ae04e
  • Fails after the first call to LoadCursorW. dab4500 - workaround. Fixed in e3ae04e
  • Fails after the first call to InvalidateRect. Fixed in 3f4695a

Solitare CE in Wiki

It's not working

solitare.exe (+pegcards.dll) is the only one supported Windows CE application which fails with exception.
image

error

Expression
CreateProcessW( VSJitDebugger, CmdLine8uf, O, O, O, oxoooooæo, O, O,
&Startuplnfo, &lnfo) O
is TRUE.
Error 2 - The system cannot find the file specified.
Note: this dialog shows every time when expression is true, however
there may be correct cases when it's really expected to be true.

Steps to reproduce the behavior:

  1. Download WinCE 6 Software from here: https://archive.org/details/winCE6soft
  2. Extract the zip.
  3. Download the release zip from github.
  4. Extract the release zip.
  5. Go to any folder that has programs in the winCE6soft folder.
  6. Put the file that you picked into CoredllTest.exe
  7. See error

I thought it was gonna work

OS: [Windows 10]
Browser [Chrome]
Version [19045.4170]

Create own function checker

Feature Description (optional)
Program which loads all module imports and checks if there are such in WCECL.
Also it would be great if this program could make a list of required functions in wcecl .def style

GetExitCodeProcess=GetExitCodeProcess_WCECL @519
CreateDirectoryW=CreateDirectoryW_WCECL @160
GetDiskFreeSpaceExW=GetDiskFreeSpaceExW_WCECL @184
FileTimeToSystemTime=FileTimeToSystemTime_WCECL @20
SystemTimeToFileTime=SystemTimeToFileTime_WCECL @21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.