FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ayuda Funciones a Bajo Nivel
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Mon Jun 09, 2014 05:35 PM
Esta versi贸n corrige un error de la anterior pero a煤n no est谩 dando la informaci贸n que buscamos:

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <hbapi.h>
#include <Windows.h>

HB_FUNC( TEST )
{
聽 聽HANDLE disk0; 
聽 聽DWORD retCount, dwRet = 0; 
聽 聽// GETVERSIONINPARAMS versionInfo;
聽 聽SENDCMDINPARAMS stCIP;
聽 聽char szOutput[ 512 + 16 ]; // OUT_BUFFER_SIZE IDENTIFY_BUFFER_SIZE+16

聽 聽/* get a handle for physical disk 0 (the C: drive) */
聽 聽if ((disk0 = CreateFile (
聽 聽 聽 L"\\\\.\\PhysicalDrive0",
聽 聽 聽 GENERIC_READ, 
聽 聽 聽 NULL, 
聽 聽 聽 NULL, 
聽 聽 聽 OPEN_EXISTING, 
聽 聽 聽 FILE_ATTRIBUTE_NORMAL, 
聽 聽 聽 NULL)) == INVALID_HANDLE_VALUE) 
聽 聽{
聽 聽 聽 MessageBox( 0, "1", "Info", 0 );
聽 聽 聽 return; 
聽 聽}

聽 聽 memset( szOutput, 0, sizeof( szOutput ) ); 

聽 聽 #define DRIVE_HEAD_REG聽 0xA0

聽 聽聽stCIP.cBufferSize=IDENTIFY_BUFFER_SIZE;
聽 聽 stCIP.bDriveNumber = 0; // ucDriveIndex;
聽 聽 stCIP.irDriveRegs.bFeaturesReg= 0;
聽 聽 stCIP.irDriveRegs.bSectorCountReg = 1;
聽 聽 stCIP.irDriveRegs.bSectorNumberReg = 1;
聽 聽 stCIP.irDriveRegs.bCylLowReg = 0;
聽 聽 stCIP.irDriveRegs.bCylHighReg = 0;
聽 聽 stCIP.irDriveRegs.bDriveHeadReg = DRIVE_HEAD_REG;
聽 聽 stCIP.irDriveRegs.bCommandReg = ID_CMD;

聽 聽 if ( DeviceIoControl( disk0, SMART_RCV_DRIVE_DATA, &stCIP, sizeof(stCIP), szOutput, 512 + 16,
聽 聽 聽 聽 聽&dwRet, NULL) )
聽 聽 {
聽 聽 聽 聽MessageBox( 0, "pasa", "ok", 0 );
聽 聽 }

聽 聽MessageBox( 0, szOutput, "buffer", 0 );

/* close everything & go home */
聽 聽CloseHandle (disk0); 
聽 聽// hb_retclen( szOutput, dwRet );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Mon Jun 09, 2014 05:39 PM
Esta es la mejor versi贸n que he encontrado hasta ahora para el uso del interface SMART.

Ahora se trata de buscar aqui los valores que necesitas:

http://munin-monitoring.org/browser/munin-node-win32/src/plugins/disk/SmartReader.cpp
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Mon Jun 09, 2014 06:28 PM
Prueba con esta:

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <hbapi.h>
#include <Windows.h>

HB_FUNC( TEST )
{
     char szVolumeLetter[32];
     char szPhysicalDrive[64];

     HANDLE hPhysicalDriveIOCTL = CreateFile(L"\\\\.\\PhysicalDrive0", GENERIC_READ | GENERIC_WRITE,

                FILE_SHARE_READ  | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);

     if(hPhysicalDriveIOCTL != INVALID_HANDLE_VALUE)

     {

                DWORD dwBytesReturned = 0;

         

                // Get Physical Drive Information

                VOLUME_DISK_EXTENTS   vdExtents;
                GETVERSIONINPARAMS  gvopVersionParams;


                ZeroMemory(&vdExtents,   sizeof(vdExtents));

                if(!DeviceIoControl(hPhysicalDriveIOCTL,   IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,  NULL, 0,

                     &vdExtents,   sizeof(vdExtents),  &dwBytesReturned, NULL)){

                     MessageBox( 0 , "Error   volumes  that span multiple disks are not supported!", "sorry", 0 );

                     CloseHandle(hPhysicalDriveIOCTL);

                     return    1;

                }



                // Get SMART version information

                ZeroMemory(&gvopVersionParams,   sizeof(gvopVersionParams));

                if(!DeviceIoControl(hPhysicalDriveIOCTL,   SMART_GET_VERSION,  NULL, 0,

                     &gvopVersionParams ,  sizeof(gvopVersionParams), &dwBytesReturned, NULL)){

                     MessageBox( 0, "Error   cannot  get SMART version information from device!", "warning", 0 );

                     CloseHandle(hPhysicalDriveIOCTL);

                return 1;

                }

        

                if(gvopVersionParams.bIDEDeviceMap > 0)

                {

                     // Setup SMART request

                     SENDCMDINPARAMS   InParams  = {

                             IDENTIFY_BUFFER_SIZE,  { 0, 1, 1, 0, 0, ((vdExtents.Extents[0].DiskNumber & 1) ? 0xB0 : 0xA0),

                             ((gvopVersionParams.bIDEDeviceMap  >> vdExtents.Extents[0].DiskNumber & 0x10) ? ATAPI_ID_CMD : ID_CMD) },

                             (BYTE)vdExtents.Extents [0].DiskNumber

                     };
 
                        

                       DWORD dwBufSize = sizeof(SENDCMDOUTPARAMS) + IDENTIFY_BUFFER_SIZE;

                     SENDCMDOUTPARAMS pbtIDOutCmd; //   = (PSENDCMDOUTPARAMS) new BYTE[dwBufSize];

                     ZeroMemory(&pbtIDOutCmd,  dwBufSize);

                     
 
                       // Get SMART information

                     if(DeviceIoControl (hPhysicalDriveIOCTL, SMART_RCV_DRIVE_DATA, &InParams, sizeof(SENDCMDINPARAMS),

                             &pbtIDOutCmd,  dwBufSize, &dwBytesReturned, NULL))

                     {

                           // Little Endian To Big Endian

                             USHORT  *pIDSector = (USHORT*)pbtIDOutCmd.bBuffer;
                             int nShort;
                             char lpszSerialNumber1[ 21 ];
                             LPSTR  lpszSerialNumber2;

                             for( nShort = 10; nShort < 21; nShort++)

                                   pIDSector [nShort] = (((pIDSector[nShort] & 0x00FF) << 8) + ((pIDSector[nShort] & 0xFF00) >> 8));

                            

                            // Get Drive Serial Number

                             ZeroMemory(lpszSerialNumber1, 21);

                             RtlCopyMemory(lpszSerialNumber1,  &pIDSector[10], 20);

                            

                            // Remove those horrible spaces caused because of endianess

                           // and print out the serial

                             lpszSerialNumber2 = lpszSerialNumber1;

                             while(*lpszSerialNumber2  == ' ') lpszSerialNumber2++;

                             MessageBox( 0, "Physical  Serial:", lpszSerialNumber2, 0);

                             // delete  lpszSerialNumber1;

                     }

                     // delete    pbtIDOutCmd;
 
                

                }else{
 
                     printf ("Error  !\n");

                     CloseHandle(hPhysicalDriveIOCTL);

                     return    1;

                }

                CloseHandle  (hPhysicalDriveIOCTL);
   }
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 12:23 AM
Probando y compilando,

Resultados:

El primer c贸digo que me sugirio al llmarlo comoTEST() no hace nada, no aparece nada, si lo invoco como MSGINFO(TEST()) aparece "nil"

El segundo c贸digo solo muestra un msgbox con "Info 1"

El tercer c贸digo no compila salen errores y warnings:

Warning W8075 hardDsk.c 13: Suspicious pointer conversion in function HB_FUN_TEST
Warning W8081 hardDsk.c 39: void functions may not return a value in function HB_FUN_TEST
Warning W8081 hardDsk.c 57: void functions may not return a value in function HB_FUN_TEST
Error E2063 hardDsk.c 71: Illegal initialization in function HB_FUN_TEST
Warning W8081 hardDsk.c 142: void functions may not return a value in function HB_FUN_TEST
Warning W8067 hardDsk.c 148: Both return and return with a value used in function HB_FUN_TEST


Aqui le dejo los fuentes del programa CrystalDiskInfo, que es en lo que me estoy basando.. Mis conocimientos en C son escasos para el nivel de programaci贸n de estos codigos..

https://www.mediafire.com/?vcwmzmfypgbv7lf

Saludos..
Soluciones y Dise帽o de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Dise帽ador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 07:59 AM
Este c贸digo fuenciona correctamente compilando con Visual Studio, pero falla con Borland (a煤n no he encontrado por que no funciona con Borland):

serial.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

聽 聽MsgInfo( SerialNumber() )

return nil

//----------------------------------------------------------------------------//

#pragma BEGINDUMP

#include <hbapi.h>
#include <Windows.h>

HB_FUNC(SERIALNUMBER)
{
聽 聽 HANDLE hPhysicalDriveIOCTL = 0;

聽 聽 hPhysicalDriveIOCTL = (HANDLE)CreateFile(L"\\\\.\\PhysicalDrive0", 0,
聽 聽 聽 聽 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
聽 聽 聽 聽 OPEN_EXISTING, 0, NULL);

聽 聽 if (hPhysicalDriveIOCTL != INVALID_HANDLE_VALUE)
聽 聽 {
聽 聽 聽 聽 STORAGE_PROPERTY_QUERY query;
聽 聽 聽 聽 DWORD cbBytesReturned = 0;
聽 聽 聽 聽 char buffer[10000];

聽 聽 聽 聽 memset((void *)&query, 0, sizeof(query));
聽 聽 聽 聽 query.PropertyId = StorageDeviceProperty;
聽 聽 聽 聽 query.QueryType = PropertyStandardQuery;

聽 聽 聽 聽 memset(buffer, 0, sizeof(buffer));

聽 聽 聽 聽 if (DeviceIoControl(hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY,
聽 聽 聽 聽 聽 聽 &query,
聽 聽 聽 聽 聽 聽 sizeof(query),
聽 聽 聽 聽 聽 聽 &buffer,
聽 聽 聽 聽 聽 聽 sizeof(buffer),
聽 聽 聽 聽 聽 聽 &cbBytesReturned, NULL))
聽 聽 聽 聽 {
聽 聽 聽 聽 聽 聽 hb_retclen(buffer + 126, 20);
聽 聽 聽 聽 }
聽 聽 }
}

#pragma ENDDUMP




regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 08:13 AM
Funcionando con Borland :-)

serial.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

聽 聽MsgInfo( SerialNumber() )
聽 聽
return nil

//----------------------------------------------------------------------------//

#pragma BEGINDUMP

#include <hbapi.h>
#include <Windows.h>

#define IOCTL_STORAGE_QUERY_PROPERTY 0x2D1400

typedef struct _STORAGE_PROPERTY_QUERY {
聽 int PropertyId;
聽 int QueryType;
聽 BYTE AdditionalParameters[ 1 ];
} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;

HB_FUNC( SERIALNUMBER )
{
聽 聽 HANDLE hPhysicalDriveIOCTL = ( HANDLE ) CreateFile( "\\\\.\\PhysicalDrive0", 0,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽OPEN_EXISTING, 0, NULL);

聽 聽 if( hPhysicalDriveIOCTL != INVALID_HANDLE_VALUE )
聽 聽 {
聽 聽 聽 聽 STORAGE_PROPERTY_QUERY query;
聽 聽 聽 聽 DWORD cbBytesReturned = 0;
聽 聽 聽 聽 char buffer[ 10000 ];

聽 聽 聽 聽 memset( ( void * ) &query, 0, sizeof( query ) );
聽 聽 聽 聽 query.PropertyId = 0; // StorageDeviceProperty;
聽 聽 聽 聽 query.QueryType = 0; 聽// PropertyStandardQuery;

聽 聽 聽 聽 memset( buffer, 0, sizeof( buffer ) );

聽 聽 聽 聽 if( DeviceIoControl( hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY,
聽 聽 聽 聽 聽 聽 聽 &query,
聽 聽 聽 聽 聽 聽 聽 sizeof( query ),
聽 聽 聽 聽 聽 聽 聽 &buffer,
聽 聽 聽 聽 聽 聽 聽 sizeof( buffer ),
聽 聽 聽 聽 聽 聽 聽 &cbBytesReturned, NULL ) )
聽 聽 聽 聽 {
聽 聽 聽 聽 聽 聽hb_retclen( buffer + 126, 20 );
聽 聽 聽 聽 }
聽 聽 聽 聽 else
聽 聽 聽 聽 聽 聽hb_retc( "can't read it" );
聽 聽 }
聽 聽 else 
聽 聽 聽 聽 聽 聽hb_retc( "can't read it" );
}

#pragma ENDDUMP


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 12:49 PM

Maestro Buen d铆a, me levante de madrugada emocionado por probar, pero en mi caso no funciona, talvez el sistema operativo me limita pues lo estoy probando bajo Xp, instale W7 en una m谩quina virtual y ah铆 si funciona, no entiendo porque no funciona, es bastante estresante no poder avanzar..

Ooh Oohh y al parecer mi disco duro vol贸, al reiniciar mi equipo ya no lo hizo, ojala y no pierda todo otra vez.. Ver茅 que puedo hacer.. Me indica error partition table

Saludos

Soluciones y Dise帽o de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Dise帽ador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 01:05 PM
Victor,

Pru茅balo as铆:

serial.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

聽 聽MsgInfo( SerialNumber() )
聽 聽
return nil

//----------------------------------------------------------------------------//

#pragma BEGINDUMP

#include <hbapi.h>
#include <Windows.h>

#define IOCTL_STORAGE_QUERY_PROPERTY 0x2D1400

typedef struct _STORAGE_PROPERTY_QUERY {
聽 int PropertyId;
聽 int QueryType;
聽 BYTE AdditionalParameters[ 1 ];
} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;

HB_FUNC( SERIALNUMBER )
{
聽 聽 HANDLE hPhysicalDriveIOCTL = ( HANDLE ) CreateFile( "\\\\.\\PhysicalDrive0", 0,
                                                    聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);

聽 聽 if( hPhysicalDriveIOCTL != INVALID_HANDLE_VALUE )
聽 聽 {
聽 聽 聽 聽 STORAGE_PROPERTY_QUERY query;
聽 聽 聽 聽 DWORD cbBytesReturned = 0;
聽 聽 聽 聽 char buffer[ 10000 ];

聽 聽 聽 聽 memset( ( void * ) &query, 0, sizeof( query ) );
聽 聽 聽 聽 query.PropertyId = 0; // StorageDeviceProperty;
聽 聽 聽 聽 query.QueryType = 0; 聽// PropertyStandardQuery;

聽 聽 聽 聽 memset( buffer, 0, sizeof( buffer ) );

聽 聽 聽 聽 if( DeviceIoControl( hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY,
聽 聽 聽 聽 聽 聽 聽 &query,
聽 聽 聽 聽 聽 聽 聽 sizeof( query ),
聽 聽 聽 聽 聽 聽 聽 &buffer,
聽 聽 聽 聽 聽 聽 聽 sizeof( buffer ),
聽 聽 聽 聽 聽 聽 聽 &cbBytesReturned, NULL ) )
聽 聽 聽 聽 {
聽 聽 聽 聽 聽 聽hb_retclen( buffer + 126, 20 );
聽 聽 聽 聽 }
聽 聽 聽 聽 else
聽 聽 聽 聽 聽 聽hb_retc( "can't read it" );
聽 聽 聽 聽 聽 聽
聽 聽 聽 聽 CloseHandle( hPhysicalDriveIOCTL ); 聽 
聽 聽 }
聽 聽 else 
聽 聽 聽 聽 聽 聽hb_retc( "can't read it" );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 01:06 PM

Victor,

La aplicaci贸n GetSerialDiskDemo.exe funciona bien en XP ?

En los c贸digos fuente que he revisado todos usan los flags FILE_SHARE_READ | FILE_SHARE_WRITE pero pudiera ser que ese flag FILE_SHARE_WRITE sea el culpable de da帽ar el disco duro. Ante la duda, lo quitamos y ademas faltaba la llamada a CloseHandle().

En la 煤ltima versi贸n que acabo de poner incluye estos cambios.

No puedes probar en XP en maquina virtual ? Asi te evitas el peligro de que pueda da帽ar el disco duro, aunque si ya no usamos FILE_SHARE_WRITE no veo como pudiese resultar da帽ado. Y si se da帽贸, lo siento de veras. Usar esta tecnolog铆a (SMART) que habla directamente con el controlador del disco es muy potente pero obviamente tiene tambien sus riesgos por lo que comentas.

Yo lo he probado en Windows 8 64 bits y funciona correctamente.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 01:24 PM

Fiu.. Gracias por ser tan amable de comentar Maestro..

Bueno el disco duro volvio con trabajos pero volvio, lo revise con Hirens Boot Cd y me indicaban los programas de recuperacion que mis particiones desaparecienron, volvi a reiniciar y tardo pero arranco XP, de hecho hace rato escribi desde mi movil, y ahora lo hago desde mi maquina.. No hay problema no hay de que disculparse es parte de trabajar con este tipo de funciones, se que es muy peligroso pues trabajamos a muy bajo nivel del disco duro y entiendo los riesgos, lo bueno es que pude reiniciarlo y estoy respaladando datos porque vi que quedo tocado..

Bueno a lo que vamos, el archivo GetSerialDiskDemo.exe si corre perfectamente en XP, de hecho tambien CrystalDiskInfo del cual tengo los fuentes tambien corre perfecto en XP, por eso no entiendo porque estas pruebas no dan resultados,

Voy a instalar XP en Virtual para hacer pruebas, de hecho tengo W/ corriendo en Virtual Pc, la verdad me resisto como muchos a cambiar a W7 o W8 porque es demasiado restrictivo hasta para trabajar con Fivewin..

Soluciones y Dise帽o de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Dise帽ador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 01:48 PM

Victor,

Que problemas tienes con W7 贸 W8 ? Yo actualmente programo y desarrollo FWH en Windows 8 (tanto 32 bits como 64 bits) y funcionan correctamente. De hecho en mi opini贸n W7 es bastante mejor que XP, pues usa mucho m谩s eficientemente la memoria.

La 煤ltima versi贸n que he publicado de la funci贸n que necesitas no deber铆a ya ser peligrosa, de todas formas, ten la precauci贸n de realizar tus backups y para mayor seguridad a煤n pru茅bala desde un XP virtual. En Windows 8 64 bits funciona bien.

Si otros usuarios se atreven a usarla, cuidado, no sabemos si lo que le ha ocurrido a Victor pueda estar relacionado con esta funci贸n. Asi que ojo, no vayais a estropear el arranque del disco (a nivel software). Y si a alguien le funciona bien en XP por favor que lo comente para que asi sepamos con certeza que el problema de Victor no est谩 relacionado con el uso de esta funci贸n.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 04:01 PM

Despu茅s del susto he regresado a probarlo, quite las particiones de mi disco duro y las volv铆 a crear, en una con XP y la otra con W7, el resultado funciona pero con W7 en XP solo lanza el msginfo vac铆o, maestro Antonio ha podido revisar los fuentes de Crystaldiskinfo que le envie? En Xp funciona bien.

W7 es muy latoso, no puedo borrar carpetas dentro de mi disco de proyectos con un simple archivo. bat siempre me sale con que necesito permisos cuando soy Administrador, quita tiempo estar abriendo programas y te ptegunte si es seguro, me estresa un tanto su entorno lo siento muy limitante.. Adem谩s de que muchos equipos no migran a W7 o W8 por lo mismo

Soluciones y Dise帽o de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Dise帽ador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 04:25 PM

Victor,

Es que los fuentes que he revisado en relaci贸n a la tecnolog铆a SMART son bastante complicados, m谩s que nada porque es una forma de programar que principalmente usan los desarrolladores de drivers, de ahi que no me es familiar en absoluto.

Las mayor铆a de los fuentes estan en C++ y no permiten una portabilidad a C tal cual. Ayer hice muchas pruebas y el c贸digo que he publicado es realmente el 煤nico que he conseguido que funcione bien.

Lo has vuelto a probar en XP ? Te funciona ? Me interesa saber si funciona y si vuelve a ocurrirte algo en el disco duro, gracias

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 07:02 PM

Antonio
En el hd del equipo que lo has desarrollado y probado, tienes m谩s de una partici贸n?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Funciones a Bajo Nivel
Posted: Tue Jun 10, 2014 07:46 PM

Cristobal,

Si, pero lo que est谩 obteniendo es el n煤mero de serie del disco (grabado en hardware), no el serial que le da Windows al formatear (grabado en software), si no me equivoco.

regards, saludos

Antonio Linares
www.fivetechsoft.com