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.

135 lines
4.7 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Job Scheduler Service
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  7. //
  8. // File: job.cxx
  9. //
  10. // Contents: Stubs for the Job handler methods that are not in job.lib.
  11. //
  12. // Notes: This module allows job.lib to be statically linked into
  13. // mstask.exe. job.lib is built in sched\job and is linked to
  14. // both mstask.dll and mstask.exe. The *real* code resides in
  15. // sched\client\job.cxx.
  16. //
  17. // BUGBUG : We *must* split CJob et al interface(s) into two
  18. // classes: a small core base class, and an OLE
  19. // supporting subclass. This would be a *significant*
  20. // code savings in the service .exe. For example,
  21. // we would not need the E_NOTIMPL stub functions in
  22. // this file, or the CJob::Save implementation.
  23. //
  24. // History: 14-Nov-95 EricB created
  25. // 06-Jun-96 MarkBl Renamed from juistubs.cxx and added
  26. // Get/SetAccountInformation.
  27. //
  28. //-----------------------------------------------------------------------------
  29. #include "..\pch\headers.hxx"
  30. #pragma hdrstop
  31. #include "svc_core.hxx"
  32. // ref count global (not actually used since the service is an exe not a dll)
  33. // UINT g_cDllRefs;
  34. //+----------------------------------------------------------------------------
  35. //
  36. // Member: CJob::ITask::EditWorkItem
  37. //
  38. // Synopsis: Stub. Actual code in sched\client\jobedit.cxx and compiled
  39. // into mstask.dll.
  40. //
  41. //-----------------------------------------------------------------------------
  42. STDMETHODIMP
  43. CJob::EditWorkItem(HWND hParent, DWORD dwReserved)
  44. {
  45. return E_NOTIMPL;
  46. }
  47. //+----------------------------------------------------------------------------
  48. //
  49. // Member: CJob::IProvideTaskPage::GetPage
  50. //
  51. // Synopsis: Stub. Actual code in sched\client\job.cxx and compiled
  52. // into job.dll.
  53. //
  54. //-----------------------------------------------------------------------------
  55. STDMETHODIMP
  56. CJob::GetPage(
  57. TASKPAGE tpType,
  58. BOOL fPersistChanges,
  59. HPROPSHEETPAGE * phPage)
  60. {
  61. return E_NOTIMPL;
  62. }
  63. //+----------------------------------------------------------------------------
  64. //
  65. // Member: CJob::ITask::SetAccountInformation
  66. //
  67. // Synopsis: Stub. Actual code in sched\client\job.cxx and compiled
  68. // into mstask.dll. This is necessary, as otherwise, it would
  69. // be necessary to include the client rpc code into the service!
  70. //
  71. //-----------------------------------------------------------------------------
  72. STDMETHODIMP
  73. CJob::SetAccountInformation(
  74. LPCWSTR pwszAccountName,
  75. LPCWSTR pwszPassword)
  76. {
  77. return(E_NOTIMPL);
  78. }
  79. //+----------------------------------------------------------------------------
  80. //
  81. // Member: CJob::ITask::GetAccountInformation
  82. //
  83. // Synopsis: Stub. Actual code in sched\client\job.cxx and compiled
  84. // into mstask.dll. This is necessary, as otherwise, it would
  85. // be necessary to include the client rpc code into the service!
  86. //
  87. //-----------------------------------------------------------------------------
  88. STDMETHODIMP
  89. CJob::GetAccountInformation(
  90. LPWSTR * ppwszAccountName)
  91. {
  92. return(E_NOTIMPL);
  93. }
  94. //+----------------------------------------------------------------------------
  95. //
  96. // Member: CJob::IPersistFile::Save
  97. //
  98. // Synopsis: saves the object to storage
  99. //
  100. // Arguments: [pwszFileName] - if null, save to the previously loaded file.
  101. // [fRemember] - if TRUE, the object becomes associated with
  102. // the new filename.
  103. //
  104. // Notes: Sigh... New security code in IPersistFile::Save. The security
  105. // code is client-only; the service doesn't need it. This is
  106. // Save() sans security. As mentioned, if the split wasn't made,
  107. // we'd have to include the client rpc code into the service.
  108. //
  109. // All OLE32 strings are UNICODE, including the filename passed
  110. // in the IPersistFile methods.
  111. //
  112. //-----------------------------------------------------------------------------
  113. STDMETHODIMP
  114. CJob::Save(
  115. LPCOLESTR pwszFileName,
  116. BOOL fRemember)
  117. {
  118. HRESULT hr;
  119. //
  120. // Always do a full save. Never alter the running instance count from the
  121. // COM interface method.
  122. //
  123. hr = SaveWithRetry(pwszFileName, fRemember, SAVEP_VARIABLE_LENGTH_DATA);
  124. return(hr);
  125. }