Re: win32 or native NT windows API



Vikas Kumar wrote:
Hi
I am curious as to what do regular windows assembly program writers use
for system calls ?
Do they always use the WIN32 API or do they directly play with the
native NT Windows API (Nt* functions). ?

It depends on the needs of the application, but you'll find that most
prefer the end-user interfance of Win32 rather than the native NT API.
There's not really enough benefit to justify the headaches.

The lack/scarcity of documentation regarding the latter is a deterrent
though.
Is using the native NT APi worth all the trouble ?

Not in my experience. There are a few niceties, and occasionally you
need to drop down to it, but for the most part you can do everything
you need to do with the Win32 interface.

Has anyone used it and gained speed/efficiency ? (Assuming that your
application makes so many system calls, that using the native NT API vs
WIN32 api might make a difference)

I haven't seen any significant difference so far.

In Linux, we can use the system calls directly by using the syscall
functionality in the unistd.h header file in both 32 and 64 bit mode.
What do users do on Windows ?

Link with the appropriate end-user DLL and make standard Windows
function calls.

The reason I am asking this is that what if I want to write an
application that does not need a Microsoft runtime DLL to run, say
MSVCRT.dll or something similar.

It doesn't work like that. Even the native NT API requires you to link
with ntdll.dll. Somewhere along the line you need to access a DLL to
use the system interface. It could be through the use of a linker, or
directly in the import section of your executable, or even a few layers
down from some other library you choose to link with statically. Even
Windows interrupts are something of a wrapper around system calls.

Regards,
Vikas

.



Relevant Pages

  • Re: RUNDLL32.EXE
    ... 0x66800000 0x155000 Windows Shell Common Dll ... 0x75FA0000 0xA000 BSD Socket API for Windows ... 0x794D0000 0x15000 Microsoft WinSock Extension APIs ...
    (comp.security.firewalls)
  • Re: undestroyable process
    ... Since when Windows hooks spy upon API ... including injection of DLL into the fogeign ... inject a DLL into some system process ...
    (microsoft.public.win32.programmer.kernel)
  • Re: newbe about API
    ... Emne: Re: newbe about API ... > I found all these API-CALL strings are finally compiled to ... more than that...and Windows simply takes this to an extreme that this ... DLL, when a weak point is found (which, with Microsoft, is something ...
    (alt.lang.asm)
  • Skype codec
    ... user32.dll Windows XP USER API Client DLL ... LINKINFO.dll Windows Volume Tracking ... SETUPAPI.dll Windows Setup API ... MSVFW32.dll Microsoft Video for Windows DLL ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: In the Shallow End
    ... When a document claims how an API is supposed to be used and then gives the user examples that actually work, ... Vague in your instance means you have no context to VMS or UNIX of that era. ... Windows offers lots of this stuff. ... That's why Apple had to dump a whole paradigm to plunge ahead and take the lead. ...
    (comp.sys.mac.advocacy)