Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If I can have honesty, it's easier to overlook mistakes. -- Kirk, "Space Seed", stardate 3141.9


devel / comp.os.ms-windows.programmer.win32 / Re: console calling graphics

SubjectAuthor
* console calling graphicsPaul Edwards
`* console calling graphicsJJ
 `- console calling graphicsPaul Edwards

1
console calling graphics

<014e609f-4748-41c5-ba2e-20349b9441a5n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9924&group=comp.os.ms-windows.programmer.win32#9924

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
X-Received: by 2002:ad4:4bb0:0:b0:635:6fb4:ec58 with SMTP id i16-20020ad44bb0000000b006356fb4ec58mr9104qvw.1.1689993343124;
Fri, 21 Jul 2023 19:35:43 -0700 (PDT)
X-Received: by 2002:a05:6808:2012:b0:3a1:c163:6022 with SMTP id
q18-20020a056808201200b003a1c1636022mr8510310oiw.4.1689993342795; Fri, 21 Jul
2023 19:35:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.ms-windows.programmer.win32
Date: Fri, 21 Jul 2023 19:35:42 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=136.158.103.253; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 136.158.103.253
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <014e609f-4748-41c5-ba2e-20349b9441a5n@googlegroups.com>
Subject: console calling graphics
From: mutazi...@gmail.com (Paul Edwards)
Injection-Date: Sat, 22 Jul 2023 02:35:43 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 37
 by: Paul Edwards - Sat, 22 Jul 2023 02:35 UTC

I realized I have a design problem.

I have existing console mode applications, e.g. hexdump.

I don't really want to change them, but I can rebuild them
all if required, with some minor technical change in the
executable, so long as they still function as console mode
programs that work with msvcrt.dll on win95, win 10, win 11 etc.

The problem is that in the win32s environment (which exists
on Windows 3.11 and potentially modern OS/2), the msvcrt.dll
that I provide (aka PDPCLIB), can be freely changed for the
Win32s environment, but currently the DLL entry point is
DllMainCRTStartup (and that is still the case in win32s), but
I somehow need some parameters from Windows:

int WINAPI WinMain(IN HINSTANCE inst,
IN HINSTANCE previnst,
IN LPSTR cmd,
IN int cmdshow)

I am only using "inst" and "cmdshow" in my (sample) code.

So if DllMainCRTStartup is called (it looks like that is an
arbitrary name I can change), but what is not arbitrary is
that Windows will call it with:

BOOL __stdcall _DllMainCRTStartup(HINSTANCE hinstDll,
DWORD fdwReason,
LPVOID lpvReserved)

So how am I supposed to get access to "inst" and "cmdshow"
so that I can start doing graphics for something that
otherwise looks like a console mode application (hexdump.exe
certainly is, but I do have flexibility over whether msvcrt.dll is
considered something different)?

Thanks. Paul.

Re: console calling graphics

<g7qpxekvlga8$.ruc5z4kj7w2l$.dlg@40tude.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9925&group=comp.os.ms-windows.programmer.win32#9925

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj4pub...@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: console calling graphics
Date: Sat, 22 Jul 2023 10:17:51 +0700
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <g7qpxekvlga8$.ruc5z4kj7w2l$.dlg@40tude.net>
References: <014e609f-4748-41c5-ba2e-20349b9441a5n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="9a4329b452487855a528e0ef42cb2bfb";
logging-data="3858589"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uCtE2snoXZfY0RFCiG9uQBLB9uKa7IK4="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:dL8myZpNC9FJCfONQ75sqHT+RYM=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Sat, 22 Jul 2023 03:17 UTC

On Fri, 21 Jul 2023 19:35:42 -0700 (PDT), Paul Edwards wrote:
> I realized I have a design problem.
>
> I have existing console mode applications, e.g. hexdump.
>
> I don't really want to change them, but I can rebuild them
> all if required, with some minor technical change in the
> executable, so long as they still function as console mode
> programs that work with msvcrt.dll on win95, win 10, win 11 etc.
>
> The problem is that in the win32s environment (which exists
> on Windows 3.11 and potentially modern OS/2), the msvcrt.dll
> that I provide (aka PDPCLIB), can be freely changed for the
> Win32s environment, but currently the DLL entry point is
> DllMainCRTStartup (and that is still the case in win32s), but
> I somehow need some parameters from Windows:
>
> int WINAPI WinMain(IN HINSTANCE inst,
> IN HINSTANCE previnst,
> IN LPSTR cmd,
> IN int cmdshow)
>
> I am only using "inst" and "cmdshow" in my (sample) code.
>
> So if DllMainCRTStartup is called (it looks like that is an
> arbitrary name I can change), but what is not arbitrary is
> that Windows will call it with:
>
> BOOL __stdcall _DllMainCRTStartup(HINSTANCE hinstDll,
> DWORD fdwReason,
> LPVOID lpvReserved)
>
> So how am I supposed to get access to "inst" and "cmdshow"
> so that I can start doing graphics for something that
> otherwise looks like a console mode application (hexdump.exe
> certainly is, but I do have flexibility over whether msvcrt.dll is
> considered something different)?
>
> Thanks. Paul.

You'd have to "walk" back the stack to get to WinMain's arguments.

Re: console calling graphics

<2b347d3f-7aa6-44a5-b4cd-3bd6f915c1f0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9926&group=comp.os.ms-windows.programmer.win32#9926

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
X-Received: by 2002:a05:6214:1907:b0:635:90f3:3a0d with SMTP id er7-20020a056214190700b0063590f33a0dmr9931qvb.6.1689997325637;
Fri, 21 Jul 2023 20:42:05 -0700 (PDT)
X-Received: by 2002:a05:6870:c7b0:b0:1b0:41da:daa8 with SMTP id
dy48-20020a056870c7b000b001b041dadaa8mr4853860oab.1.1689997325121; Fri, 21
Jul 2023 20:42:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.ms-windows.programmer.win32
Date: Fri, 21 Jul 2023 20:42:04 -0700 (PDT)
In-Reply-To: <g7qpxekvlga8$.ruc5z4kj7w2l$.dlg@40tude.net>
Injection-Info: google-groups.googlegroups.com; posting-host=136.158.103.253; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 136.158.103.253
References: <014e609f-4748-41c5-ba2e-20349b9441a5n@googlegroups.com> <g7qpxekvlga8$.ruc5z4kj7w2l$.dlg@40tude.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2b347d3f-7aa6-44a5-b4cd-3bd6f915c1f0n@googlegroups.com>
Subject: Re: console calling graphics
From: mutazi...@gmail.com (Paul Edwards)
Injection-Date: Sat, 22 Jul 2023 03:42:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2107
 by: Paul Edwards - Sat, 22 Jul 2023 03:42 UTC

On Saturday, July 22, 2023 at 11:17:54 AM UTC+8, JJ wrote:

> > BOOL __stdcall _DllMainCRTStartup(HINSTANCE hinstDll,
> > DWORD fdwReason,
> > LPVOID lpvReserved)
> >
> > So how am I supposed to get access to "inst" and "cmdshow"
> > so that I can start doing graphics for something that
> > otherwise looks like a console mode application (hexdump.exe
> > certainly is, but I do have flexibility over whether msvcrt.dll is
> > considered something different)?

> You'd have to "walk" back the stack to get to WinMain's arguments.

Ok, thanks, I'll see what I can do.

I have committed the raw proposed code:

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/makefile.wcs

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/win32s.c

but now need to glue it together as you indicated above.

BFN. Paul.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor