Solved

Problem reading/writing sectors

Posted on 1998-03-25
7
245 Views
Last Modified: 2012-05-04
I made a program in Turbo Pascal 7.0 that sometimes reads sectors (using REGS and INTR standard procedures) from a floppy disk and writes it back to the same sector when my program do some modifications to the information, But sometimes in Windows 95 (DOS box) when I do this operation many times, the program "read" the sector but not writes its contents back (no writes anything). When I try this program in Windows NT (MS-DOS Console), it reads the sector but not writes back anything(!). What happen in this two cases? I need DPMI or something? The program works without problems in Win95 DOS Only-Mode and DOS 6.x. Thanks a Lot!!!
0
Comment
Question by:mapadu2000
7 Comments
 
LVL 2

Expert Comment

by:omsec
ID: 1217417
Windows 95 and Windows NT 4.0 use different FATs. I think there is the problem.
0
 

Author Comment

by:mapadu2000
ID: 1217418
What programming tool (language) I need for re-write the application as Win32 Console App? Thanks a Lot
0
 
LVL 2

Expert Comment

by:omsec
ID: 1217419
it depends, if u still want a program designed for DOS or (Dos-Mode) i think it can be done with BP7 (protected mode) or if you wish a 32-bit win-exe you could use Delphi, this is pascal based
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:mapadu2000
ID: 1217420
In Delphi, How I can read/writes sectors? Can you give me an example code? Thanks
0
 
LVL 1

Expert Comment

by:extreme
ID: 1217421
I suggest you to compile your program in BP7 protected mode and try if it works in that mode.
0
 
LVL 2

Expert Comment

by:omsec
ID: 1217422
you can't do direct disk reads in windows.

from win32sdk.hlp:

Windows NT: You can use the CreateFile function to open a disk drive or a partition on a disk drive. The function returns a handle to the disk device; that handle can be used with the DeviceIOControl function.
0
 
LVL 3

Accepted Solution

by:
jlove1 earned 50 total points
ID: 1217423
before running the program under windows 95.. Try using the LOCK command
lock a:

This will allow the program to have "DIRECT" access to the sectors on the drive by bypassing dos.

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of the biggest threats facing all high-value targets are APT's.  These threats include sophisticated tactics that "often starts with mapping human organization and collecting intelligence on employees, who are nowadays a weaker link than network…
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question