Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Polish the signature of CallApplicationMain in klr #1043

Closed
troydai opened this issue Jan 7, 2015 · 5 comments
Closed

Polish the signature of CallApplicationMain in klr #1043

troydai opened this issue Jan 7, 2015 · 5 comments
Assignees
Milestone

Comments

@troydai
Copy link
Contributor

troydai commented Jan 7, 2015

Here's the function pointer declaration (https://github.com/aspnet/KRuntime/blob/dev/src/klr/klr.h#L11)

typedef struct CALL_APPLICATION_MAIN_DATA
{
    LPCWSTR applicationBase; // application base of managed domain
    LPCWSTR klrDirectory; // path to KLR helper directory
    int argc; // Number of args in argv
    LPCWSTR* argv; // Array of arguments
    int exitcode; // Exit code from Managed Application
} *PCALL_APPLICATION_MAIN_DATA;

typedef HRESULT (STDAPICALLTYPE *FnCallApplicationMain)(
    PCALL_APPLICATION_MAIN_DATA pCallApplicationMainData
    );

The pCallApplicationMainData will contain the exit code, there is no need to return the it from the method again. The return type can be instead change to bool so that the caller can be further simplified.

@troydai troydai added polish and removed polish labels Jan 7, 2015
@troydai
Copy link
Contributor Author

troydai commented Mar 5, 2015

@glennc @muratg If we're not going to fix it, should we just close it?

@muratg
Copy link
Contributor

muratg commented Mar 6, 2015

@davidfowl @lodejard What are your thoughts on this one?

@glennc glennc added the polish label Mar 13, 2015
@glennc glennc added this to the Backlog milestone Mar 13, 2015
@davidfowl
Copy link
Member

Part of any clean up that @moozzyk does

@moozzyk
Copy link
Contributor

moozzyk commented Jul 7, 2015

The HRESULT returned by the FnCallApplicationMain does not represent the return value of the target function but the result of the operation of calling the target function (e.g. if for whatever reason we cannot start CoreClr the FnCallApplicationMain will return the HRESULT representing the failure and will not set the exitCode).

What we should probably fix is actually to remove this line:
https://github.com/aspnet/dnx/blob/dev/src/dnx.clr/dnx.clr.cpp#L30

@moozzyk moozzyk self-assigned this Jul 7, 2015
@moozzyk moozzyk self-assigned this Sep 28, 2015
moozzyk pushed a commit that referenced this issue Sep 28, 2015
moozzyk pushed a commit that referenced this issue Sep 29, 2015
moozzyk pushed a commit that referenced this issue Sep 29, 2015
@moozzyk
Copy link
Contributor

moozzyk commented Sep 29, 2015

Fixed in #2857

@moozzyk moozzyk closed this as completed Sep 29, 2015
@moozzyk moozzyk modified the milestones: 1.0.0-rc1, Backlog Sep 29, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants