Commits

Anonymous committed 9d99275

Some fixes.

  • Participants
  • Parent commits e6a83b8

Comments (0)

Files changed (6)

File Everything/Everything/EverythingGotoFileProvider.cs

       var solutionDir = scope.GetSolution().SolutionFilePath.Directory;
       var query = matcher.Filter;
       query = query.Replace('*', ' ');
-      query = string.Format("\"{0}\" {1}", solutionDir, query);
+      query = string.Format("\"{0}\\\" {1}", solutionDir, query);
       //EverythingApi.Reset();
       EverythingApi.SetMax(30);
       EverythingApi.SetSearch(query);

File EverythingApi/Everything.cpp

 	*buf = 0;
 }
 
+struct ThreadParams{
+	bool isUnicode;
+	bool(*checkForInterrupt)();
+};
 
 
 static DWORD EVERYTHINGAPI _Everything_thread_proc(VOID *param)
 		everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0);
 		if (everything_hwnd)
 		{
-			VOID** paramArr = (VOID **)param;
-			if (paramArr[0])
+			ThreadParams *threadParams = (ThreadParams*)param;
+			if (threadParams->isUnicode)
 			{
 				// unicode
 				len = _Everything_GetSearchLengthW();
 			
 			if (q.query)
 			{
-				if (paramArr[0])
+				if (threadParams->isUnicode)
 				{
 					q.queryW->max_results = _Everything_Max;
 					q.queryW->offset = _Everything_Offset;
 				}
 
 				cds.cbData = size;
-				cds.dwData = paramArr[0]?EVERYTHING_IPC_COPYDATAQUERYW:EVERYTHING_IPC_COPYDATAQUERYA;
+				cds.dwData = threadParams->isUnicode ?EVERYTHING_IPC_COPYDATAQUERYW:EVERYTHING_IPC_COPYDATAQUERYA;
 				cds.lpData = q.query;
 			
 				if (SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)hwnd,(LPARAM)&cds) == TRUE)
 					//WaitMessage();
 					
 					// update windows
-					bool(*interruptCheck)() = (bool (*)())paramArr[1];
+					bool(*interruptCheck)() = threadParams->checkForInterrupt;
 					while (!::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE)) {
 						if (interruptCheck())
 							goto interrupt;
 					goto loop;
 
 	interrupt:
-					while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
-					}
+					/*while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+					}*/
 
 					_Everything_LastError = EVERYTHING_ERROR_INTERRUPTED;
 
 
 
 
+
 static BOOL EVERYTHINGAPI _Everything_Query(BOOL bUnicode, bool (*checkForInterrupt)())
 {
 	HANDLE hthread;
 	DWORD threadid;
-	VOID *param[2];
+	ThreadParams param;
 	
 	// reset the error flag.
 	_Everything_LastError = 0;
 	
-	if (bUnicode)
+	param.isUnicode = bUnicode;
+
+	/*if (bUnicode)
 	{
-		param[0] = (VOID *)1;
+		param.isUnicode = (VOID *)1;
 	}
 	else
 	{
 		param[0] = 0;
-	}
+	}*/
 
-	param[1] = checkForInterrupt;
-	
+	//param[1] = checkForInterrupt;
+	param.checkForInterrupt = checkForInterrupt;
 	_Everything_IsUnicodeQuery = bUnicode;
 	
-	hthread = CreateThread(0,0,_Everything_thread_proc,param,0,&threadid);
+	hthread = CreateThread(0,0,_Everything_thread_proc,&param,0,&threadid);
 		
 	if (hthread)
 	{
 	{
 		_Everything_LastError = EVERYTHING_ERROR_CREATETHREAD;
 	}
-	
+	//delete [] param;
 	return (_Everything_LastError == 0)?TRUE:FALSE;
 }
 

File EverythingApi/EverythingApi.h

 		delegate bool CheckForInterrupt();
 
 		static bool Query(Boolean bWait, CheckForInterrupt ^checkForInterrupt) {
+			GCHandle gch = GCHandle::Alloc(checkForInterrupt);
 			IntPtr ip = Marshal::GetFunctionPointerForDelegate(checkForInterrupt);
 			bool(*interrupt)() = static_cast<bool(*)()>(ip.ToPointer());
 			return ::Everything_Query(bWait, interrupt);
+			gch.Free();
 		}
 
 		//// query reply

File EverythingApi/dll.vcxproj

       <OmitFramePointers>false</OmitFramePointers>
       <WholeProgramOptimization>false</WholeProgramOptimization>
       <PreprocessorDefinitions>BZ_NO_STDIO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
+      <StringPooling>false</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <OutputFile>$(OutDir)Everything.dll</OutputFile>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
       <ModuleDefinitionFile>everything.def</ModuleDefinitionFile>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateMapFile>true</GenerateMapFile>
       <SubSystem>Windows</SubSystem>
       <StackReserveSize>0</StackReserveSize>

File EverythingEverything.nuspec

 <package >
   <metadata>
     <id>EverythingEverything</id>
-    <version>0.1-alpha</version>
+    <version>0.1.1-alpha</version>
     <title>Everything Everything</title>
     <authors>Ethereal Code</authors>
     <projectUrl>http://bitbucket.org/Nerzhul500/everything-everything</projectUrl>    
     <description>
       Goto provider (Ctrl-N) for search through all files under solution directory. Based on Everything search engine by voidtools.com.
 
+      Request examples:
+      \bi \Debug\ - match all files and directories in directories with name Debug that are located under directory starting with "bi"
+      \bi \Debug\ dll - the same as above, but matches files and directories by "dll" as well
+  	  \ - match all files and dirs under solution root
+  	  \ proj - matches all files and directories with name that contains "proj"
+
+
       ATTENTION!
       To get this extension working properly you have to:
       * Install and run Everything tool (download exactly 1.2.1.371 version from here http://www.voidtools.com/).
     <dependencies>
       <dependency id="ReSharper" version="[8.2,8.3)" />
     </dependencies>
-    <releaseNotes>First unstable build</releaseNotes>
+    <releaseNotes>Crash fixed</releaseNotes>
   </metadata>
   <files>
     <file src="target\Release\8.2\**\*.*" target="ReSharper\v8.2\plugins\" />

File EverythingSample/EverythingSample.csproj

     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Everything, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\EverythingApi\Debug\Everything.dll</HintPath>
+    <Reference Include="Everything">
+      <HintPath>..\EverythingApi\Release\Everything.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />