Source code of Windows XP (NT5)
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.

213 lines
12 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 1997.
  5. //
  6. // File: dllreg.cxx
  7. //
  8. // Contents: Null and Plain Text filter registration
  9. //
  10. // History: 21-Jan-97 dlee Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #include <pch.cxx>
  14. #pragma hdrstop
  15. #include <filtreg.hxx>
  16. extern HANDLE ghDllInstance;
  17. WCHAR wszDllFullPath[MAX_PATH+1];
  18. SClassEntry const aTheNullClasses[] =
  19. {
  20. { L".aif", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  21. { L".aps", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  22. { L".asf", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  23. { L".avi", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  24. { L".bin", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  25. { L".bsc", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  26. { L".cab", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  27. { L".cgm", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  28. { L".com", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  29. { L".dbg", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  30. { L".dct", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  31. { L".dll", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  32. { L".eps", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  33. { L".exe", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  34. { L".exp", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  35. { L".eyb", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  36. { L".fnt", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  37. { L".fon", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  38. { L".ghi", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  39. { L".gif", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  40. { L".hqx", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  41. { L".ico", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  42. { L".ilk", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  43. { L".inv", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  44. { L".jbf", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  45. { L".jpg", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  46. { L".lib", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  47. { L".m14", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  48. { L".mdb", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  49. { L".mmf", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  50. { L".mov", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  51. { L".movie", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  52. { L".msg", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  53. { L".mv", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  54. { L".ncb", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  55. { L".obj", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  56. { L".ocx", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  57. { L".pch", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  58. { L".pdb", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  59. { L".pdf", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  60. { L".pds", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  61. { L".pic", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  62. { L".pma", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  63. { L".pmc", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  64. { L".pml", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  65. { L".pmr", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  66. { L".psd", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  67. { L".res", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  68. { L".rpc", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  69. { L".rsp", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  70. { L".sbr", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  71. { L".sc2", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  72. { L".sym", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  73. { L".sys", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  74. { L".tar", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  75. { L".tif", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  76. { L".tiff", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  77. { L".tlb", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  78. { L".tsp", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  79. { L".ttc", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  80. { L".ttf", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  81. { L".wav", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  82. { L".wll", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  83. { L".wlt", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  84. { L".wmf", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  85. { L".xix", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  86. { L".z", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  87. { L".z96", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  88. { L".zip", L"BinaryFile", L"Binary file", L"{08c524e0-89b0-11cf-88a1-00aa004b9986}", L"Binary file" },
  89. };
  90. SHandlerEntry const TheNullHandler =
  91. {
  92. L"{098f2470-bae0-11cd-b579-08002b30bfeb}",
  93. L"Null persistent handler",
  94. L"{c3278e90-bea7-11cd-b579-08002b30bfeb}"
  95. };
  96. SFilterEntry const TheNullFilter =
  97. {
  98. L"{c3278e90-bea7-11cd-b579-08002b30bfeb}",
  99. L"Null filter",
  100. wszDllFullPath,
  101. L"Both"
  102. };
  103. DEFINE_REGISTERFILTER( TheNull,
  104. TheNullHandler,
  105. TheNullFilter,
  106. aTheNullClasses )
  107. SClassEntry const aPlainTextClasses[] =
  108. {
  109. // .dic files are marked as txtfiles by Office install
  110. { L".dic", L"PlainText", L"Plain ASCII/UniCode text file", L"{89bcb7a4-6119-101a-bcb7-00dd010655af}", L"Plain ASCII/UniCode text file" },
  111. { L".txt", L"PlainText", L"Plain ASCII/UniCode text file", L"{89bcb7a4-6119-101a-bcb7-00dd010655af}", L"Plain ASCII/UniCode text file" },
  112. { L".wtx", L"PlainText", L"Plain ASCII/UniCode text file", L"{89bcb7a4-6119-101a-bcb7-00dd010655af}", L"Plain ASCII/UniCode text file" },
  113. { L".bat", L"batfile", L"MS-DOS Batch File", L"{89bcb7a5-6119-101a-bcb7-00dd010655af}", L"MS-DOS Batch File" },
  114. { L".cmd", L"cmdfile", L"Windows Command Script", L"{89bcb7a6-6119-101a-bcb7-00dd010655af}", L"Windows Command Script" },
  115. { L".idq", L"idqfile", L"Microsoft Query parameter file", L"{961c1130-89ad-11cf-88a1-00aa004b9986}", L"Microsoft Query parameter file" },
  116. { L".ini", L"inifile", L"Configuration Settings", L"{8c9e8e1c-90f0-11d1-ba0f-00a0c906b239}", L"Configuration Settings" },
  117. { L".inx", L"inxfile", L"Setup Settings", L"{95876eb0-90f0-11d1-ba0f-00a0c906b239}", L"Setup Settings" },
  118. { L".reg", L"regfile", L"Registration Entries", L"{9e704f44-90f0-11d1-ba0f-00a0c906b239}", L"Registration Entries" },
  119. { L".inf", L"inffile", L"Setup Information", L"{9ed4692c-90f0-11d1-ba0f-00a0c906b239}", L"Setup Information" },
  120. };
  121. SHandlerEntry const PlainTextHandler =
  122. {
  123. L"{5e941d80-bf96-11cd-b579-08002b30bfeb}",
  124. L"Plain Text persistent handler",
  125. L"{c1243ca0-bf96-11cd-b579-08002b30bfeb}"
  126. };
  127. SFilterEntry const PlainTextFilter =
  128. {
  129. L"{c1243ca0-bf96-11cd-b579-08002b30bfeb}",
  130. L"Plain Text filter",
  131. wszDllFullPath,
  132. L"Both"
  133. };
  134. DEFINE_REGISTERFILTER( PlainText,
  135. PlainTextHandler,
  136. PlainTextFilter,
  137. aPlainTextClasses )
  138. //
  139. // Extra entries for CI Framework. They happen to have the same form as the filter
  140. // entries.
  141. //
  142. SFilterEntry const FrameworkControl =
  143. {
  144. L"{47C67B50-70B5-11D0-A808-00A0C906241A}",
  145. L"Content Index Framework Control Object",
  146. wszDllFullPath,
  147. L"Both"
  148. };
  149. SFilterEntry const ISearchCreator =
  150. {
  151. L"{1F247DC0-902E-11D0-A80C-00A0C906241A}",
  152. L"Content Index ISearch Creator Object",
  153. wszDllFullPath,
  154. L"Both"
  155. };
  156. extern "C" STDAPI DllRegisterServer(void)
  157. {
  158. if (0 == GetModuleFileName((HMODULE)ghDllInstance, wszDllFullPath, MAX_PATH))
  159. {
  160. Win4Assert(!"Now, why did we fail to get module filename?");
  161. // we failed to get the full path name. default to just the filename
  162. wcscpy(wszDllFullPath, L"ocifrmwk.dll");
  163. }
  164. SCODE sc = TheNullRegisterServer();
  165. if ( S_OK == sc )
  166. sc = PlainTextRegisterServer();
  167. if ( S_OK == sc )
  168. sc = RegisterAFilter( FrameworkControl );
  169. if ( S_OK == sc )
  170. sc = RegisterAFilter( ISearchCreator );
  171. return sc;
  172. } //DllRegisterServer
  173. extern "C" STDAPI DllUnregisterServer(void)
  174. {
  175. SCODE sc = TheNullUnregisterServer();
  176. SCODE sc2 = PlainTextUnregisterServer();
  177. SCODE sc3 = UnRegisterAFilter( FrameworkControl );
  178. SCODE sc4 = UnRegisterAFilter( ISearchCreator );
  179. if ( FAILED( sc ) )
  180. return sc;
  181. if ( FAILED( sc2 ) )
  182. return sc2;
  183. if ( FAILED( sc3 ) )
  184. return sc3;
  185. return sc4;
  186. } //DllUnregisterServer