Solved

Problem reading/writing sectors

Posted on 1998-03-25
7
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Today’s effective marketing is about coming down to the customers’ level and engaging in a whole new way. A text message is one of the most effective and influential ways that you can engage your customers. Here are eight ways that you can utilize t…
Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

696 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