Author Topic: ntvdm.dll  (Read 28353 times)

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: ntvdm.dll
« Reply #15 on: December 15, 2012, 07:26:17 AM »
i feel like i am watching Firefly/Serenity, except it's German instead of Chinese   :lol:

Magnum

  • Member
  • *****
  • Posts: 2367
Re: ntvdm.dll
« Reply #16 on: December 15, 2012, 07:29:31 AM »
Sorry Dave, I could tell you but then I would have to snuff you out. (JOKE)

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: ntvdm.dll
« Reply #17 on: December 15, 2012, 08:49:22 AM »
deleted
« Last Edit: February 25, 2022, 05:59:03 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: ntvdm.dll
« Reply #18 on: December 15, 2012, 08:50:41 AM »
deleted
« Last Edit: February 25, 2022, 05:59:18 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: ntvdm.dll
« Reply #19 on: December 15, 2012, 08:51:50 AM »
deleted
« Last Edit: February 25, 2022, 05:59:32 AM by nidud »

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1196
Re: ntvdm.dll
« Reply #20 on: December 15, 2012, 05:07:08 PM »
On my Windows 2000 system there is a ntvdm.exe and a ntvdmd.dll, but no ntvdm.dll. On my Windows XP SP3 system there is only ntvdm.exe, and this is the DEF file for it:
Code: [Select]
LIBRARY ntvdm.exe
EXPORTS
BlockWOWIdle
CurrentMonitorTeb DATA
DBGNotifyDebugged
DBGNotifyNewTask
DBGNotifyRemoteThreadAddress
DispatchInterrupts
Dos_Flag_Addr DATA
DpmiSetIncrementalAlloc
ExpLdt DATA
FlatAddress DATA
GetDOSAppName
GetWOWShortCutInfo
IsCdRomFile
MGetVdmPointer
RegisterWOWIdle
ResumeTimerThread
SelectorLimit DATA
SetShadowDescriptorEntries
Sim32pGetVDMPointer
SoftPcEoi
SuspendTimerThread
VDDAllocMem
VDDAllocateDosHandle
VDDAssociateNtHandle
VDDDeInstallIOHook
VDDDeInstallMemoryHook
VDDDeInstallUserHook
VDDExcludeMem
VDDFreeMem
VDDIncludeMem
VDDInstallIOHook
VDDInstallMemoryHook
VDDInstallUserHook
VDDQueryDMA
VDDReleaseDosHandle
VDDReleaseIrqLine
VDDRequestDMA
VDDReserveIrqLine
VDDRetrieveNtHandle
VDDSetDMA
VDDSimulate16
VDDTerminateVDM
VdmDbgAttach
VdmGetParametersInfoError
VdmMapFlat
VdmParametersInfo
VdmTraceEvent
WOWSysErrorBox
WaitIfIdle
call_ica_hw_interrupt
cmdCheckTemp
cmdCheckTempInit
cpu_createthread
demClientErrorEx
demFileDelete
demFileFindFirst
demFileFindNext
demGetCurrentDirectoryLCDS
demGetFileTimeByHandle_WOW
demGetPhysicalDriveType
demIsShortPathName
demLFNCleanup
demLFNGetCurrentDirectory
demSetCurrentDirectoryGetDrive
demSetCurrentDirectoryLCDS
demWOWLFNAllocateSearchHandle
demWOWLFNCloseSearchHandle
demWOWLFNEntry
demWOWLFNGetSearchHandle
demWOWLFNInit
fSeparateWow DATA
getAF
getAH
getAL
getAX
getBH
getBL
getBP
getBX
getCF
getCH
getCL
getCS
getCX
getDF
getDH
getDI
getDL
getDS
getDX
getEAX
getEBP
getEBX
getECX
getEDI
getEDX
getEFLAGS
getEIP
getES
getESI
getESP
getFS
getGS
getIF
getIP
getIntelRegistersPointer
getMSW
getOF
getPF
getSF
getSI
getSP
getSS
getZF
host_CreateThread
host_ExitThread
host_com_close
host_direct_access_error
host_simulate
pDeviceChain DATA
setAF
setAH
setAL
setAX
setBH
setBL
setBP
setBX
setCF
setCH
setCL
setCS
setCX
setDF
setDH
setDI
setDL
setDS
setDX
setEAX
setEBP
setEBX
setECX
setEDI
setEDX
setEFLAGS
setEIP
setES
setESI
setESP
setFS
setGS
setIF
setIP
setMSW
setOF
setPF
setSF
setSI
setSP
setSS
setZF

The exports for the Windows 2000 ntvdm.exe are largely the same, but there are some significant differences.

Well Microsoft, here’s another nice mess you’ve gotten us into.

japheth

  • Guest
Re: ntvdm.dll
« Reply #21 on: December 15, 2012, 07:14:19 PM »
An example how to use the exports of ntvdm.exe in a Win32 dll ( VDD ): wde031.zip ( it's binary and source, GPL license! )

The DOS program, WDE, is a disk editor. If the disk is FAT, it knows how to handle it - but no NTSF. The VDD makes this program work in a NT DOS-Box ( admin privileges! ).

Code: [Select]
WDe Copyright(C)2005 Ben Cadieux (ben.cadieux@gmail.com)

WDe.com         V0.30b MD5: 0908554d480fc646c594fe046fd3e985
WDeTest.com     V0.30b MD5: 9d427d3aa2f6ab394ad873271d9870c5

About/License:
  WDe is designed to be a modular disk editor capable of allowing users
  to manipulate data stored in various ways on different kinds of storage
  mediums.

  WDe is currently capable of editing logical, physical and CD-Rom drives
  on MS-DOS V4.0+ or compatible.  It should (theoretically) be able to edit
  drives up to 2 TB in size.

  I strongly recommend using a cache utility (such as SMARTDrive) to speed
  up functions that would otherwise be quite slow.

  This program is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License (Version 2) as published
  by the Free Software Foundation.

  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Notes about V0.22b:
  Included in this release is WDeTest.com; a semi-completed new menu
  system being considered for future releases of WDe.  This version should
  only be used as a preview for feedback to the author, since a great
  deal of code needed to be moved or changed to allow for the new menu.
  WDeTest.com may also lack some fixes found in WDe.com.

  The project's future is uncertain, WDe may be ported to Linux or moved
  towards being OS-independant.  There are plans to add support for more
  partition types such as NTFS, UFS and Ext2/3.  Comments, ideas and
  suggestions would be appreciated; a simple e-mail might change WDe's path.

Updates in V0.30b:
  - fixed a small bug in the hex printing code
  - separated int 13h buffers for getting drive info and reading/writing,
  - reversed display of attribute bits in directory view to match binary
  - fixed root cluster number display bug
  - enhanced finding MBR; less chance of a false positive
  - sector saving/restoring can no longer read/write outside drive parameters
  - fixed bug in fat functions allowing them to read/write past fat tables
  - added workaround to Win9x bug for theoretical writes to CD-Roms
  - fixed bootsector display bug that occurred under certain conditions
  - read functions fixed and reversed back to oldest to newest
  - fixed bug switching to drives that were unable to be edited
  - optimized code that converts values to hex strings
  - modified menu system to be more versatile
  - fixed bug getting fat entry data for last few allowable clusters
    on maximally sized Fat12 and Fat16 partitions
  - enhanced/corrected directory detection; less false negatives/positives
  - updated file/path character checking; this further improves directory
    finding and accepts more characters as valid input when undeleting
  - unformat function has been re-designed, re-written and implemented
  - bytes per sector returned by int 13h/48h now used for hard disks
  - hitting enter in the fat area now works regardless of the view set
  - fixed bug causing restore chain to default to second fat in directories
  - fixed rare bug causing Fat16 partitions to be shown as Fat32
  - file sharing violation crashes under windows fixed by having int 24h
    return "fail" instruction to the calling code
  - running out of disk space while writing a file now aborts with an error
  - last sector bound now kept for non-physical drives restricted as physical
  - restricting above as physical now always correctly sets last sector
  - defaults to Fat1 if saving/restoring Fat2 when none exists
  - fixed major partition saving bug (saving was starting at MBR)
  - fixed partition saving/restoring bug causing it to miss last sector
  - fixed CHS display code for high sector numbers
  - CHS no longer displayed when switching from physical to non-physical
  - workarounds added for CHS reading with poorly written BIOSes
  - searching for String/Hex on CDs no longer randomly stops
  - excessive amounts of code clean-up & optimization for speed and size
  - much better system implemented to generate random values
  - fixed some fat type detection problems
  - MBR view now shows Linux, FreeBSD and NTFS as partition types

Planned Updates:
  - directory location function
  - defrag function (maybe)
  - further modularization of source code
  - better CHS hard disk identification (int13h/ah=25h, ah=48h)
  - bootsector view changes to make easy Fat1x/Fat32 distinction
  - 2gb file limit check revising for append
  - 4gb file limit check for fat32
  - rather than filesize limits; file splitting options
  - case insensitive search
  - fat32 root save/restore implemented for all linked clusters
  - better fat finding (entry repetition checking)
  - file chain saving guess cluster order for deleted files
  - restore previous video mode on quit
  - some CD "goto" functions
  - revision of "goto" functions for physical reading of floppy drives
  - drive scan function to report/fix errors
  - editing support (with tab) in view area
  - lfn support for undeleting files
  - support for reading sector numbers that are bigger than a dword
  - searches should move cursor to start of found string
  - searching should have a "find again" feature
  - bug finding fat12 partitions on hard disks (descriptor byte)
  - unreadable sectors should be shown as blanked/dashed
  - save/restore entire hard drive needed
  - ability to mount drives as drive letters (maybe)
  - file manager mode (maybe)

Vortex

  • Member
  • *****
  • Posts: 2697
Re: ntvdm.dll
« Reply #22 on: December 15, 2012, 08:08:17 PM »
Hi nidud,

You are right. I modified my def2lib tool to create the correct entries in the import library. I modified the .def file too. Kindly, could you check the attachment again?

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: ntvdm.dll
« Reply #23 on: December 15, 2012, 11:20:02 PM »
deleted
« Last Edit: February 25, 2022, 05:57:16 AM by nidud »

Vortex

  • Member
  • *****
  • Posts: 2697
Re: ntvdm.dll
« Reply #24 on: December 15, 2012, 11:28:41 PM »
Hi nidud,

Thanks for testing the import library.

pcMike

  • Member
  • **
  • Posts: 51
Re: ntvdm.dll
« Reply #25 on: September 13, 2015, 03:41:56 AM »
nidud, Thank you for writing this program. It solved an issue in which a DOS BOP command was unable to register a Win32 VDD DLL which was compiled using the NTVDM.LIB included with MASM 10 and 11.

Vortex: I tried the second version of the NTVDM.LIB which you created using your def2lib tool, but for some reason the resulting DLL would not work with my application. Could I get a copy of def2lib to play around with?
[Edit] I should have said I tried both your posted LIB files, with and without the patch fix.

Regards,  Mike

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: ntvdm.dll
« Reply #26 on: September 13, 2015, 04:56:51 AM »
def2lib does not create DLL's - it creates import libraries (LIB)

Erol (Vortex) has many great tools for working with libraries and object modules, etc...

http://www.vortex.masmcode.com/

Vortex

  • Member
  • *****
  • Posts: 2697
Re: ntvdm.dll
« Reply #27 on: September 13, 2015, 05:40:12 AM »
Hi pcMike,

As Dave said, def2lib does not create DLLs. The purpose of this tool is to convert a module definition file ( .def ) to a MS COFF import library.

Here is a small test environment :

Code: [Select]
lib2def .\ntvdm1999\NTVDM.LIB

def2lib ntvdm.def -e

lib2def creates a .def file from the import library stored in the ntvdm1999 folder.

def2lib will convert this .def file to the import library ntvdm.lib  In other words, the import library is recreated from the module definition file.

The attachment contains lib2def, def2lib, the .def file and the import libraries.

You can also download the tools from my website.

pcMike

  • Member
  • **
  • Posts: 51
Re: ntvdm.dll
« Reply #28 on: September 13, 2015, 08:48:18 AM »
Hi Dedndave and Vortex,

I understand that def2lib does not create DLL files.

Let me clarify what I was trying to say... I tested the version of NTVDM.LIB which Vortex created using his def2lib tool, and both versions he made available in this thread would not allow me to build a functional VDD DLL file, as the file could not be registered by a using a DOS BOP "register VDD" command. 

I had the same issue with Hutch's NTVDM.LIB file when I upgraded to MASM32 version 10,  since earlier versions of MASM32 did not include NTVDM.LIB so I always used my own version of that Library (the 1999 version) which has always worked fine over the years.  I didn't like the idea of replacing the original MASM32 library files with a different version, because in my old age I might forget that this is needed a few years later down the road when I upgrade things. Actually this just occurred, as I finally got around to upgrading to MASM32 version 11 this week, and then I encountered he same issue, causing my software to fail to function after compiling it with the MASM32 NTVDM.LIB file.

Hopefully now that Hutch is aware of the issue and it's cause, he can patch the library file in the next MASM32 release. :)

Vortex, thanks for posting the def2lib tool, I'll try playing with it.

Regards,  Mike


hutch--

  • Administrator
  • Member
  • ******
  • Posts: 9760
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: ntvdm.dll
« Reply #29 on: September 13, 2015, 09:29:25 AM »
Mike,

I think you misunderstand what the MASM32 project is aimed at.

> Hopefully now that Hutch is aware of the issue and it's cause, he can patch the library file in the next MASM32 release. :)

The library in the MASM32 SDK will never be patched to fit such an obscure non Win32 task. If you have specialised requirements, you either use your existing library that works OK or you learn its format and create new ones that do what you need.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: