Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.3 KiB

  1. /*
  2. * DRIVES.C
  3. *
  4. * RSM Service : Drives
  5. *
  6. * Author: ErvinP
  7. *
  8. * (c) 2001 Microsoft Corporation
  9. *
  10. */
  11. #include <windows.h>
  12. #include <stdlib.h>
  13. #include <wtypes.h>
  14. #include <ntmsapi.h>
  15. #include "internal.h"
  16. #include "resource.h"
  17. #include "debug.h"
  18. DRIVE *NewDrive(LIBRARY *lib, PWCHAR path)
  19. {
  20. DRIVE *drive;
  21. drive = GlobalAlloc(GMEM_FIXED|GMEM_ZEROINIT, sizeof(DRIVE));
  22. if (drive){
  23. drive->lib = lib;
  24. WStrNCpy(drive->path, path, MAX_PATH);
  25. drive->objHeader.objType = OBJECTTYPE_DRIVE;
  26. drive->objHeader.refCount = 1;
  27. }
  28. ASSERT(drive);
  29. return drive;
  30. }
  31. VOID FreeDrive(DRIVE *drive)
  32. {
  33. GlobalFree(drive);
  34. }
  35. DRIVE *FindDrive(LPNTMS_GUID driveId)
  36. {
  37. DRIVE *drive = NULL;
  38. if (driveId){
  39. OBJECT_HEADER *objHdr;
  40. objHdr = FindObjectInGuidHash(driveId);
  41. if (objHdr){
  42. if (objHdr->objType == OBJECTTYPE_DRIVE){
  43. drive = (DRIVE *)objHdr;
  44. }
  45. else {
  46. DerefObject(objHdr);
  47. }
  48. }
  49. }
  50. return drive;
  51. }
  52. HRESULT DeleteDrive(DRIVE *drive)
  53. {
  54. HRESULT result;
  55. // BUGBUG FINISH
  56. ASSERT(0);
  57. result = ERROR_CALL_NOT_IMPLEMENTED;
  58. return result;
  59. }