can i make a HB_FUNC() of it ?

Post Reply
User avatar
Jimmy
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

can i make a HB_FUNC() of it ?

Post by Jimmy »

hi,

i´m still struggle with this CODE

Code: Select all | Expand

BOOL PreventRemovalOfVolume(HANDLE hVolume,  BOOL fPreventRemoval)
{
   DWORD dwBytesReturned;
   PREVENT_MEDIA_REMOVAL PMRBuffer;
   PMRBuffer.PreventMediaRemoval = (BOOL) fPreventRemoval;
   return DeviceIoControl( hVolume, IOCTL_STORAGE_MEDIA_REMOVAL,
                           &PMRBuffer, sizeof(PREVENT_MEDIA_REMOVAL),
                           NULL, 0, &dwBytesReturned, NULL );
}
HB_FUNC.PRG(148): warning C4244: "=": Konvertierung von "BOOL" in "BOOLEAN", möglicher Datenverlust
HB_FUNC.PRG(156): warning C4431: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C nicht mehr unterstützt.
now i "think" to use a HB_FUNC() instead

Code: Select all | Expand

HB_FUNC( PROV ) //PreventRemovalOfVolume
{
   HANDLE hVolume = ( HWND ) hb_parnl( 1 ) ;
   BOOL fPreventRemoval = ( BOOL) hb_parl(2) ;
   ...
   hb_retl( DeviceIoControl( ..) ) ;
}
is something like that possible :?:

---

if Yes :
what Type is "HANDLE hVolume" -> HWND :?:
does it need to check for 64 Bit
greeting,
Jimmy
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: can i make a HB_FUNC() of it ?

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Jimmy
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: can i make a HB_FUNC() of it ?

Post by Jimmy »

hi,

thx for Answer

i do have working Version under Xbase++ and HMG using DLL Call
but as i had Problem under Fivewin i have to use HB_FUNC()

my CODE look like Github Sample but that are not HB_FUNC() which i like to have

---

my Question is if i can change those "internal" API Function to single HB_FUNC()

Code: Select all | Expand

BOOL PreventRemovalOfVolume(HANDLE hVolume, BOOL fPreventRemoval)
goes to

Code: Select all | Expand

HB_FUNC(PreventRemovalOfVolume)
   HANDLE hVolume = (HWND) hb_parnl(1) ;
   BOOL fPreventRemoval = (BOOL) hb_parl(2) ;
...
hb_retl( DeviceIoControl( ... ) ) ;
greeting,
Jimmy
Post Reply