[PATCH 5/5] win16/int21: trace get_media_id calls

Oleksij Rempel bug-track at fisher-privat.net
Tue May 29 16:10:09 CDT 2012


This patch add trace for int 21, funct 440Dh
CX = 0866h - Get Media ID

It also add error warning if GetVolumeInformationW
filed. Since there was no error check, there was a long
standing bug.

Signed-off-by: Oleksij Rempel <bug-track at fisher-privat.net>
---
 dlls/krnl386.exe16/int21.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/krnl386.exe16/int21.c b/dlls/krnl386.exe16/int21.c
index 841080b..65d8ac6 100644
--- a/dlls/krnl386.exe16/int21.c
+++ b/dlls/krnl386.exe16/int21.c
@@ -2609,8 +2609,14 @@ static void INT21_Ioctl_Block( CONTEXT *context )
             {
                 WCHAR	label[12],fsname[9];
                 DWORD	serial;
+                BOOL    ret;
+                TRACE( "GENERIC IOCTL - Get media id - %c:\n",
+                       'A' + drive );
+
+                ret = GetVolumeInformationW(drivespec, label, 12, &serial, NULL, NULL, fsname, 9);
+                if(!ret)
+                    ERR("Filed to get media id.\n");
 
-                GetVolumeInformationW(drivespec, label, 12, &serial, NULL, NULL, fsname, 9);
                 *(WORD*)dataptr	= 0;
                 memcpy(dataptr+2,&serial,4);
                 WideCharToMultiByte(CP_OEMCP, 0, label, 11, (LPSTR)dataptr + 6, 11, NULL, NULL);
-- 
1.7.9.5




More information about the wine-patches mailing list