Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem reading/writing sectors

Posted on 1998-03-25
7
Medium Priority
?
249 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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 100 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Following on from our article on "The Murky World of Consent and opt in", we thought we would issue some helpful guidance, not only on consent itself but knowing what information you are capturing, what you are doing with this data and how you can p…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

876 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