Jump to content

WpQueryRootFolder: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:wpQueryRootFolder}} This instance method returns the root folder object for the logical drive that is represented by the WPDisk object. ==Syntax== _wpQueryRootFolder(somSelf) ==Parameters== ;''somSelf'' (WPDisk *) - input :Pointer to the object on which the method is being invoked. :Points to an object of class WPDisk. ==Returns== ;''RootFolder'' (WPRootFolder *) - returns :Root folder object. :Null if an error occurred. ==How to Overr..."
 
(No difference)

Latest revision as of 03:51, 25 November 2025

This instance method returns the root folder object for the logical drive that is represented by the WPDisk object.

Syntax

_wpQueryRootFolder(somSelf)

Parameters

somSelf (WPDisk *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPDisk.

Returns

RootFolder (WPRootFolder *) - returns
Root folder object.
Null if an error occurred.

How to Override

This method should not be overridden.

Usage

This method can be called at any time.

Remarks

Every instance of the WPDisk class that is created in the system points to a root folder, which is the root directory of the logical device that the disk object represents.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPDisk *somSelf; /* Pointer to the object on which the method is being invoked. */
WPRootFolder *RootFolder; /* Root folder object. */

RootFolder = _wpQueryRootFolder(somSelf);

/* Example code provided in the source: */
  ULONG ulLogicalDriveNum = 0;    /* Logical drive number returned */
  WPRootFolder *RootFolder;        /* Root folder for drive         */

  /*
   * Query logical drive number for the WPDisk object
   */

    ulLogicalDriveNum = _wpQueryLogicalDrive( self );


    if (ulLogicalDriveNum == 0) {

      somPrintf("_wpQueryLogicalDrive failed");
      return 1;

    } /* endif */


  /*
   * Query root folder also
   */

    RootFolder = _wpQueryRootFolder( self );

    if (RootFolder == NULL) {

      somPrintf("_wpQueryRootFolder failed");
      return 1;

    } /* endif */