🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11053

Re: Problems writing boot record to removable media under WinME

#11053
From: Remy Lebeau (TeamB)
Date: Mon, 01 Mar 2004 18:37
32 lines
2090 bytes
"Walt Morrey" <dadinc@bellsouth.net> wrote in message
news:40437604@newsgroups.borland.com...

> // Creating handle to vwin32.vxd (win 9x)
<snip>
> if ( hDevice == INVALID_HANDLE_VALUE )
> {
>    // win NT/2K/XP code

That is not the correct way to do OS detection.  You should be using
GetVersionEx() instead, or use the VCL's global Win32Platform variable.  You
should access VWIN32.VXD only under Win9x/ME, and if it fails then it is an
error and you need to abort what you are doing.  For example:

    if( Win32Platform == VER_PLATFORM_WIN32_NT )
        // win NT/2K/XP code
    else
        // win 9x/Me code

>     reg.reg_EAX = drive;    // Int 26h drive numbers are 0-based.

Why are you using Int 26h?  Why not Int 21h Function 440Dh Minor Code 41h,
or Int 21h Function 7305h?  In fact, that last one replaces Int 26h.  It
looks like that was the one you were originally trying to use, correct?

BTW, you should also be locking the media/volume before altering it, and
then unlocking it afterwards.  That ensures that nothing else is trying to
access themedia while you are altering it.


Gambit
Technical Details
Message-ID: <404380f3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40437604@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,5a57fca3b977b3f5
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-03-01 10:40:18 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40437604@newsgroups.borland.com>
Subject: Re: Problems writing boot record to removable media under WinME
Date: Mon, 1 Mar 2004 10:37:32 -0800
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.138.253
Message-ID: <404380f3$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1078165747 67.22.138.253 (1 Mar 2004 10:29:07 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail