Re: [announcement] SYSAPI and SYSSVC for Windows

From: Ekkehard Morgenstern (ekkehard.morgenstern_at_onlinehome.de)
Date: 12/16/03


Date: Tue, 16 Dec 2003 01:56:20 +0100


"Stephen Leake" <stephen_leake@acm.org> wrote:
> > SYSAPI is a package that interfaces directly to the Microsoft Windows API.
>
> More precisely, to a _very_ small subset, dealing with synchronous and
> asynchronous file IO.

That statement of mine didn't elaborate on the scope of the package,
I clarified that a couple of paragraphs later in my original post, to which
you also replied. Please read the entire post before you reply to anything.
This prevents things from being taken out of context. :)

> > I will also add windowing and graphics support (especially for DirectX
> > Graphics, formerly known as DirectDraw and Direct 3D), and also audio and
> > video support.
>
> Before you do that, you should look at the other Ada Windows bindings
> out there; see www.adapower.com. Rather than start another one,
> consider adding to one of those; that will be much more useful.

I've looked at a couple of other Ada Windows bindings, and didn't find them
satisfying, either because they're out of date, or because they're too
expensive. I also explained this point in another post of this thread. :)

I'm not sure whether one of the existing packages can be extended.

Win32Ada looks like it needs a big update, and I don't have the time to do
an update of the entire binding. Also, since the GNAT DLL tools cannot link
to the new XP libraries (because of all-Stdcall exports), I decided to
abstract things with a DLL specifically written for GNAT.

> > For now, it contains only file services, namely 64-bit synchronous and
> > asynchronous services. I've seen that the GNAT libraries do not provide
> > those, and hence I had to write my own. I need 64-bit file I/O for a
> > database project of my own (to allow for files bigger than 4 GB).
>
> ok. Even better would be to add this to the GNAT Ada.Text_IO runtime!
> If you get it working, I bet ACT would be happy to include it in GNAT.

It would require file size and positioning APIs to support Large_Integers.

It would also require that there's a dynamic binding to some of the Windows
API functions. For example, GetFileSizeEx() is supported only on Windows
2000 and XP, while GetFileSize() is cumbersome to use but works with older
releases as well.

I could modify GNAT if I get the source and a proper compilation environment
for it. :)

I suspect GNAT's Windows support hasn't been updated for a while, and
somebody's got to do that. :)

> As for style, it is better to provide at least some comments in the
> spec saying what the functions do. Since you say these are not thin
> bindings, I have no idea what the various functions are for, beyond
> the English meaning of their names.

Yes, I've not added comments in some of the source files, I will when
I get around to it. :)

> You have constants CFALSE and CTRUE in the spec; that doesn't sound
> like a thick Ada binding, it sounds like a thin one. Almost every
> function returns a CBOOL, or has a CBOOL out parameter; what do they
> mean? A thick Ada binding should raise exceptions for errors (or one
> exception, with an error message string).

Perhaps you have misunderstood the concept. I've explained what the two
packages do already in my original post.

SYSAPI is the layer that sits directly on top of the Windows API,
a thin layer or so, you might say.

SYSSVC provides the Ada-related services to call SYSAPI. You should also
take a look at the SYSSVC package and its spec file. I do throw exceptions
for failed I/O requests in SYSSVC. So that provides the thick layer, I guess.

But thanks for having a look at my code anyway! :)

Best wishes,
Ekkehard.



Relevant Pages

  • Re: Error 8000FFFF when WU search for updates
    ... transaction due to file in use or Component reboot required, package changes ... pending xml and registry identifiers ... This is because another update within the same install transaction ... The "Windows Features" dialog box is empty in Windows Vista, ...
    (microsoft.public.windowsupdate)
  • Re: Setup Error on Friends Computer
    ... Microsoft Visual Basic Enterprise Edition for Windows 6.0 ... Microsoft Visual Basic Professional Edition for Windows 6.0 ... You try to install a Microsoft Visual ... Basic 6.0 application that you package by using the Package and Deployment ...
    (microsoft.public.vb.general.discussion)
  • Re: Ruby for beginners (was: Re: Hello)
    ... installing more than one programming language. ... Neither MacOS X nor Windows have integrated package management ... Most PCs run a flavour of Windows**, according to all the data we ... Mac OS X at least includes a Ruby package in its installation. ...
    (comp.lang.ruby)
  • Re: Will not update
    ... subscription when I bought the computer less than 2 years ago. ... Checking Windows Servicing Packages ... Checking Package Manifests and Catalogs ... IF a 3rd party firewall was being used, ensure the native Vista firewall ...
    (microsoft.public.windowsupdate)
  • Re: Setup Error on Friends Computer
    ... appears my friend may have windows system files on another drive. ... > Microsoft Visual Basic Enterprise Edition for Windows 6.0 ... > Basic 6.0 application that you package by using the Package and Deployment ... > install a Visual Basic 6.0 application that you package by using the PDW ...
    (microsoft.public.vb.general.discussion)