home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / packages / win32ada / data.z / win32-winioctl.adb < prev    next >
Encoding:
Text File  |  1995-11-17  |  1.8 KB  |  49 lines

  1. -- $Source: /home/harp/1/proto/monoBANK/winnt/win32-winioctl.adb,v $ 
  2. -- $Revision: 1.2 $ $Date: 95/01/27 16:10:08 $ $Author: mg $ 
  3. -------------------------------------------------------------------------------
  4. --
  5. -- THIS FILE AND ANY ASSOCIATED DOCUMENTATION IS FURNISHED "AS IS" WITHOUT 
  6. -- WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
  7. -- TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR 
  8. -- PURPOSE.  The user assumes the entire risk as to the accuracy and the 
  9. -- use of this file.
  10. --
  11. -- Copyright (c) Intermetrics, Inc. 1995
  12. -- Royalty-free, unlimited, worldwide, non-exclusive use, modification, 
  13. -- reproduction and further distribution of this file is permitted.
  14. --
  15. -------------------------------------------------------------------------------
  16.  
  17.  
  18. package body Win32.Winioctl is
  19.  
  20.     function CTL_CODE(DeviceType, 
  21.                       Function_Name,
  22.                       Method, 
  23.                       Access_Name: Win32.DWORD)
  24.              return Win32.DWORD is
  25.         use Interfaces;
  26.     begin
  27.         return Win32.DWORD(
  28.            Shift_Left(Unsigned_32(DeviceType), 16) or
  29.            Shift_Left(Unsigned_32(Access_Name), 14) or
  30.            Shift_Left(Unsigned_32(Function_Name), 2) or
  31.            Unsigned_32(Method));
  32.     end CTL_CODE;
  33.  
  34.     function IsRecognizedPartition(PartitionType: Win32.DWORD) 
  35.         return Boolean is
  36.  
  37.         use type Win32.DWORD;
  38.         use type Interfaces.C.Unsigned_Long;
  39.         Masked_Val: constant DWORD := (DWORD(PartitionType) and not 16#C0#);
  40.     begin
  41.         return
  42.             Masked_Val = PARTITION_FAT_12 or
  43.             Masked_Val = PARTITION_FAT_16 or
  44.             Masked_Val = PARTITION_IFS    or
  45.             Masked_Val = PARTITION_HUGE;
  46.     end IsRecognizedPartition;
  47.  
  48. end Win32.Winioctl;
  49.