Skip to content

Commit 5516f78

Browse files
authored
Merge pull request #5 from amdf/wip
check if native exe
2 parents 3b90538 + 57e868a commit 5516f78

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
upload_url: ${{ steps.create_release.outputs.upload_url }}
4343
asset_path: ${{ github.workspace }}/nativeshell.zip
44-
asset_name: nativeshell.i386.zip
44+
asset_name: nativeshell-${{ github.ref }}.i386.zip
4545
asset_content_type: application/zip
4646

4747

main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ HANDLE hKeyboard;
3434
HANDLE hHeap;
3535
HANDLE hKey;
3636

37-
#define __NCLI_VER__ "0.13.0 x86"
37+
#define __NCLI_VER__ "0.13.1 x86"
3838

3939
WCHAR *helpstr[] =
4040
{
@@ -430,7 +430,7 @@ main(INT argc,
430430
// Show banner
431431
//
432432
RtlCliDisplayString("Native Shell [Version " __NCLI_VER__ "] (" __DATE__ " " __TIME__ ")\n");
433-
RtlCliDisplayString("(C) Copyright 2010-2011 amdf\n");
433+
RtlCliDisplayString("(C) Copyright 2010-2025 amdf\n");
434434
RtlCliDisplayString("(C) Copyright 2006 TinyKRNL Project\n\n");
435435
RtlCliDisplayString("Type \"help\".\n\n");
436436

process.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ NTSTATUS CreateNativeProcess(IN PCWSTR file_name, IN PCWSTR cmd_line, OUT PHANDL
4646
status = RtlCreateUserProcess(&imgpath, OBJ_CASE_INSENSITIVE, processparameters,
4747
NULL, NULL, NULL, FALSE, NULL, NULL, &processinformation);
4848

49+
if (processinformation.ImageInformation.SubSystemType != IMAGE_SUBSYSTEM_NATIVE)
50+
{
51+
RtlCliDisplayString("\nThe %S application cannot be run in native mode.\n", file_name);
52+
return STATUS_UNSUCCESSFUL;
53+
}
54+
4955
if (!NT_SUCCESS(status))
5056
{
5157
RtlCliDisplayString("RtlCreateUserProcess failed\n");

0 commit comments

Comments
 (0)