Ignore:
Timestamp:
Jul 13, 2017, 5:17:57 AM (8 years ago)
Author:
stevenhl
Message:

Import modifications from cwmm-0_2_9-work-01_10_2006.zip dated 2006-08-27

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/common_functions/sys_funcs.c

    r2 r4  
    2222#endif
    2323 
    24   /**!**************************************************/
    25   /*                                                  */
    26   /* @@DESC                                           */
    27   /*                                                  */
    28   /* This funktion returns the drive letter of the    */
    29   /* boot partition.                                  */
    30   /*                                                  */
    31   /* @@RETURNS                                        */
    32   /*                                                  */
    33   /* char chrDrive                                    */
    34   /*                                                  */
    35   /* Drive from which the system was booted.          */
    36   /*                                                  */
    37   /**!!*************************************************/
     24/*!**************************************************/
     25/*                                                  */
     26/* @@DESC                                           */
     27/*                                                  */
     28/* This funktion returns the drive letter of the    */
     29/* boot partition.                                  */
     30/*                                                  */
     31/* @@RETURNS                                        */
     32/*                                                  */
     33/* char chrDrive                                    */
     34/*                                                  */
     35/* Drive from which the system was booted.          */
     36/*                                                  */
     37/*!!*************************************************/
    3838char SysQueryBootDriveLetter(void)
    3939{
     
    7373}
    7474
    75 /**!**************************************************/
     75/*
     76   Documentation script can't handle the const keyword yet!!!!
     77*/
     78/*--->!**************************************************/
    7679/*                                                  */
    7780/* @@DESC                                           */
     
    8790/* !parsing is broken at the moment because of const and (...)              */
    8891/*                                                  */
    89 /**!!*************************************************/
     92/*!!*************************************************/
    9093void SysWriteToTrapLog(const char* chrFormat, ...)
    9194{
     
    143146/* Size of the file.                                */
    144147/*                                                  */
     148/* @@REMARKS                                        */
     149/*                                                  */
     150/* In case of a nonexistant file 0 is returned. So  */
     151/* it's necessary to first check if the file exists.*/
     152/*                                                  */
    145153/*!!*************************************************/
    146154ULONG SysQueryFileSize(char* chrFileName)
     
    179187}
    180188
     189/*!**************************************************/
     190/*                                                  */
     191/* @@DESC                                           */
     192/*                                                  */
     193/* To be written...                                 */
     194/*                                                  */
     195/*!!*************************************************/
    181196ULONG SysQueryDriveType(ULONG ulDriveNum)
    182197{
     
    215230     
    216231      //      SysWriteToTrapLog("Drive nr.: %d, rc for DSK_BLOCKREMOVABLE-> ERROR_NOT_SUPPORTED\n", ulDriveNum);
    217       sprintf(chrDev, "%c:", 'a'+ulDriveNum-1);
     232      sprintf(chrDev, "%c:", 'a'+(char)(ulDriveNum-1));
    218233      cbBuf=sizeof(buf);
    219234     
     
    350365#endif
    351366
     367/*!**************************************************/
     368/*                                                  */
     369/* @@DESC                                           */
     370/*                                                  */
     371/* To be written...                                 */
     372/*                                                  */
     373/*!!*************************************************/
    352374ULONG SysQueryFreeDriveSpace(ULONG ulDriveNum, ULONG *ulTotal, ULONG * ulFree, ULONG* ulBytesUnit)
    353375{
     
    371393}
    372394
    373 /*
    374   The returned volname is always terminated by zero.
    375   ulDriveNum:  1...26
    376  */
    377 ULONG SysQueryDiskName(ULONG ulDriveNum, ULONG ulSize, char *chrBuffer)
     395/*!**************************************************/
     396/*                                                  */
     397/* @@DESC                                           */
     398/*                                                  */
     399/* This function returns the home directory of the  */
     400/* current user.                                    */
     401/*                                                  */
     402/* @@RETURNS                                        */
     403/*                                                  */
     404/* ULONG rc                                         */
     405/*                                                  */
     406/* NO_ERROR is returned if the function succeeds.   */
     407/*                                                  */
     408/* @@PARAM                                          */
     409/*                                                  */
     410/* ULONG ulDriveNum input                           */
     411/*                                                  */
     412/* The number of the drive to be queried (1-26).    */
     413/*                                                  */
     414/* @@PARAM                                          */
     415/*                                                  */
     416/* char* chrBuffer in/out                           */
     417/*                                                  */
     418/* Pointer to a buffer where the volume name will   */
     419/* be placed.                                       */
     420/*                                                  */
     421/* @@PARAM                                          */
     422/*                                                  */
     423/* ULONG ulSize input                               */
     424/*                                                  */
     425/* Size of the name buffer.                         */
     426/*                                                  */
     427/* @@REMARKS                                        */
     428/*                                                  */
     429/* The returned name is always terminated by zero.  */
     430/*                                                  */
     431/*!!*************************************************/
     432
     433ULONG SysQueryDiskName(ULONG ulDriveNum, char *chrBuffer, ULONG ulSize)
    378434{
    379435  FSINFO fsIBuf;
     
    394450}
    395451
     452/*!**************************************************/
     453/*                                                  */
     454/* @@DESC                                           */
     455/*                                                  */
     456/* This function returns the home directory of the  */
     457/* current user.                                    */
     458/*                                                  */
     459/* @@RETURNS                                        */
     460/*                                                  */
     461/* BOOL fSuccess                                    */
     462/*                                                  */
     463/* TRUE if the home dir is specified and does exist */
     464/*                                                  */
     465/* @@PARAM                                          */
     466/*                                                  */
     467/* char* chrBuf in/out                              */
     468/*                                                  */
     469/* Pointer to a buffer where the home directory     */
     470/* name will be placed.                             */
     471/*                                                  */
     472/* @@PARAM                                          */
     473/*                                                  */
     474/* ULONG ulSize input                               */
     475/*                                                  */
     476/* Size of the name buffer.                         */
     477/*                                                  */
     478/* @@REMARKS                                        */
     479/*                                                  */
     480/* The returned string is always terminated by zero.*/
     481/* .p:                                              */
     482/* If a directory is specified in the HOME          */
     483/* environment variable but doesn't exist FALSE is  */
     484/* returned and a message is written to the apps    */
     485/* exception log.                                   */
     486/*                                                  */
     487/*!!*************************************************/
    396488BOOL SysQueryHomeDir(char* chrBuf, ULONG ulSize)
    397489{
     
    400492  if(!chrHome || !chrBuf)
    401493    return FALSE;
    402 
    403 #if 0
    404   SysWriteToTrapLog("r:\\temp: %d , r:\\bla: %d \n",
    405                     SysCheckFileExists("r:\\temp"), SysCheckFileExists("r:\\bla"));
    406 #endif
    407494
    408495  if(strlcpy(chrBuf, chrHome, ulSize)>=ulSize) {
Note: See TracChangeset for help on using the changeset viewer.