Пример #1
0
int EVERYTHINGAPI Everything_GetNumResults(VOID)
{
	int ret;
	
	_Everything_Lock();

	if (_Everything_List)
	{
		if (_Everything_IsUnicodeQuery)
		{
			ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems;
		}
		else
		{
			ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems;
		}
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;

		ret = 0;
	}

	_Everything_Unlock();
	
	return ret;
}
Пример #2
0
DWORD EVERYTHINGAPI Everything_GetTotFolderResults(VOID)
{
	DWORD ret;

	_Everything_Lock();

	if (_Everything_List)
	{
		if (_Everything_IsUnicodeQuery)
		{
			ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totfolders;
		}
		else
		{
			ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totfolders;
		}
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;

		ret = 0;
	}

	_Everything_Unlock();

	return ret;
}
Пример #3
0
LPCWSTR EVERYTHINGAPI Everything_GetSearchW(VOID)
{
	LPCWSTR ret;
	
	_Everything_Lock();

	if (_Everything_Search)
	{
		if (!_Everything_IsUnicodeSearch)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
			
			ret = NULL;
		}
		else
		{
			ret = (LPCWSTR)_Everything_Search;
		}
	}
	else
	{
		ret = L"";
	}
	
	_Everything_Unlock();

	return ret;
}
Пример #4
0
VOID EVERYTHINGUSERAPI Everything_Reset(VOID)
{
	_Everything_Lock();
	
	if (_Everything_Search)
	{
		HeapFree(GetProcessHeap(),0,_Everything_Search);
		
		_Everything_Search = 0;
	}
	
	if (_Everything_List)
	{
		HeapFree(GetProcessHeap(),0,_Everything_List);
		
		_Everything_List = 0;
	}

	// reset state
	_Everything_MatchPath = FALSE;
	_Everything_MatchCase = FALSE;
	_Everything_MatchWholeWord = FALSE;
	_Everything_Regex = FALSE;
	_Everything_LastError = FALSE;
	_Everything_Max = EVERYTHING_IPC_ALLRESULTS;
	_Everything_Offset = 0;
	_Everything_IsUnicodeQuery = FALSE;
	_Everything_IsUnicodeSearch = FALSE;

	_Everything_Unlock();
}
Пример #5
0
VOID EVERYTHINGAPI Everything_SetReplyWindow(HWND hWnd)
{
	_Everything_Lock();

	_Everything_ReplyWindow = hWnd;

	_Everything_Unlock();
}
Пример #6
0
VOID EVERYTHINGAPI Everything_SetOffset(DWORD dwOffset)
{
	_Everything_Lock();

	_Everything_Offset = dwOffset;

	_Everything_Unlock();
}
Пример #7
0
VOID EVERYTHINGAPI Everything_SetMatchWholeWord(BOOL bEnable)
{
	_Everything_Lock();

	_Everything_MatchWholeWord = bEnable;

	_Everything_Unlock();
}
Пример #8
0
VOID EVERYTHINGAPI Everything_SetMatchCase(BOOL bEnable)
{
	_Everything_Lock();

	_Everything_MatchCase = bEnable;

	_Everything_Unlock();
}
Пример #9
0
VOID EVERYTHINGAPI Everything_SetMax(DWORD dwMax)
{
	_Everything_Lock();

	_Everything_Max = dwMax;

	_Everything_Unlock();
}
Пример #10
0
VOID EVERYTHINGAPI Everything_SetReplyID(DWORD nId)
{
	_Everything_Lock();

	_Everything_ReplyID = nId;

	_Everything_Unlock();
}
Пример #11
0
VOID EVERYTHINGAPI Everything_SetRegex(BOOL bEnable)
{
	_Everything_Lock();

	_Everything_Regex = bEnable;

	_Everything_Unlock();
}
Пример #12
0
HWND EVERYTHINGAPI Everything_GetReplyWindow(VOID)
{
	HWND ret;
	
	_Everything_Lock();

	ret = _Everything_ReplyWindow;

	_Everything_Unlock();
	
	return ret;
}
Пример #13
0
BOOL EVERYTHINGAPI Everything_GetMatchCase(VOID)
{
	BOOL ret;
	
	_Everything_Lock();
	
	ret = _Everything_MatchCase;

	_Everything_Unlock();
	
	return ret;
}
Пример #14
0
DWORD EVERYTHINGAPI Everything_GetMax(VOID)
{
	BOOL ret;
	
	_Everything_Lock();
	
	ret = _Everything_Max;

	_Everything_Unlock();
	
	return ret;
}
Пример #15
0
DWORD EVERYTHINGAPI Everything_GetOffset(VOID)
{
	BOOL ret;
	
	_Everything_Lock();
	
	ret = _Everything_Offset;

	_Everything_Unlock();
	
	return ret;
}
Пример #16
0
BOOL EVERYTHINGAPI Everything_GetMatchWholeWord(VOID)
{
	BOOL ret;
	
	_Everything_Lock();
	
	ret = _Everything_MatchWholeWord;

	_Everything_Unlock();
	
	return ret;
}
Пример #17
0
BOOL EVERYTHINGAPI Everything_GetRegex(VOID)
{
	BOOL ret;
	
	_Everything_Lock();
	
	ret = _Everything_Regex;

	_Everything_Unlock();
	
	return ret;
}
Пример #18
0
DWORD EVERYTHINGAPI Everything_GetLastError(VOID)
{
	DWORD ret;
		
	_Everything_Lock();
	
	ret = _Everything_LastError;

	_Everything_Unlock();
	
	return ret;
}
Пример #19
0
DWORD EVERYTHINGAPI Everything_GetReplyID(VOID)
{
	DWORD ret;
	
	_Everything_Lock();

	ret = _Everything_ReplyID;

	_Everything_Unlock();
	
	return ret;
}
Пример #20
0
BOOL EVERYTHINGAPI Everything_IsFileResult(int nIndex)
{
	BOOL ret;
	
	_Everything_Lock();

	if (_Everything_List)
	{
		if (nIndex < 0)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			ret = FALSE;
			
			goto exit;
		}
		
		if (nIndex >= Everything_GetNumResults())
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			ret = FALSE;
			
			goto exit;
		}
		
		if (_Everything_IsUnicodeQuery)
		{
			ret = !(((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex].flags & (EVERYTHING_IPC_DRIVE|EVERYTHING_IPC_FOLDER));
		}
		else
		{
			ret = !(((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex].flags & (EVERYTHING_IPC_DRIVE|EVERYTHING_IPC_FOLDER));
		}
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;

		ret = FALSE;
	}
	
exit:

	_Everything_Unlock();
	
	return ret;
}
Пример #21
0
BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait)
{
	BOOL ret;
	
	_Everything_Lock();
	
	if (bWait)	
	{
		ret = _Everything_Query(TRUE);
	}
	else
	{
		ret = _Everything_SendIPCQuery(TRUE);
	}

	_Everything_Unlock();
	
	return ret;
}
Пример #22
0
LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(DWORD nIndex)
{
	LPCWSTR ret;

	_Everything_Lock();

	if ((_Everything_List) && (_Everything_IsUnicodeQuery))
	{
		if (nIndex < 0)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;

			ret = NULL;

			goto exit;
		}

		if (nIndex >= ((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;

			ret = NULL;

			goto exit;
		}

		ret = EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex]);
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;

		ret = NULL;
	}

exit:

	_Everything_Unlock();

	return ret;
}
Пример #23
0
LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(int nIndex)
{
	LPCSTR ret;
	
	_Everything_Lock();

	if ((_Everything_List) && (!_Everything_IsUnicodeQuery))
	{
		if (nIndex < 0)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			ret = NULL;
			
			goto exit;
		}
		
		if (nIndex >= (int)((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			ret = NULL;
			
			goto exit;
		}
		
		ret = EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]);
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;

		ret = NULL;
	}
	
exit:

	_Everything_Unlock();
	
	return ret;
}
Пример #24
0
LPCSTR EVERYTHINGAPI Everything_GetResultPathA(int nIndex)
{
	LPCSTR ret;
	
	_Everything_Lock();

	if (_Everything_List)
	{
		if (nIndex < 0)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			ret = NULL;
			
			goto exit;
		}
		
		if (nIndex >= (int)((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			ret = NULL;
			
			goto exit;
		}
		
		ret = EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]);
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;

		ret = NULL;
	}

exit:
	
	_Everything_Unlock();
	
	return ret;
}
Пример #25
0
VOID EVERYTHINGAPI Everything_SortResultsByPath(VOID)
{
	_Everything_Lock();
	
	if (_Everything_List)
	{
		if (_Everything_IsUnicodeQuery)
		{
			qsort(((EVERYTHING_IPC_LISTW *)_Everything_List)->items,((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems,sizeof(EVERYTHING_IPC_ITEMW),_Everything_CompareW);
		}
		else
		{
			qsort(((EVERYTHING_IPC_LISTA *)_Everything_List)->items,((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems,sizeof(EVERYTHING_IPC_ITEMA),_Everything_CompareA);
		}
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
	}

	_Everything_Unlock();
}
Пример #26
0
VOID EVERYTHINGAPI Everything_SetSearchA(LPCSTR lpString)
{
	int size;
	
	_Everything_Lock();
	
	if (_Everything_Search) HeapFree(GetProcessHeap(),0,_Everything_Search);
	
	size = _Everything_StringLengthA(lpString) + 1;

	_Everything_Search = (LPWSTR )HeapAlloc(GetProcessHeap(),0,size);
	if (_Everything_Search)
	{
		CopyMemory(_Everything_Search,lpString,size);
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_MEMORY;
	}

	_Everything_IsUnicodeSearch = 0;

	_Everything_Unlock();
}
Пример #27
0
VOID EVERYTHINGAPI Everything_SetSearchW(LPCWSTR lpString)
{
	int len;
	
	_Everything_Lock();
	
	if (_Everything_Search) HeapFree(GetProcessHeap(),0,_Everything_Search);
	
	len = _Everything_StringLengthW(lpString) + 1;

	_Everything_Search = HeapAlloc(GetProcessHeap(),0,len*sizeof(wchar_t));
	if (_Everything_Search)
	{
		CopyMemory(_Everything_Search,lpString,len*sizeof(wchar_t));
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_MEMORY;
	}
	
	_Everything_IsUnicodeSearch = 1;
	
	_Everything_Unlock();
}
Пример #28
0
int EVERYTHINGAPI Everything_GetResultFullPathNameW(int nIndex,LPWSTR wbuf,int wbuf_size_in_wchars)
{
	int len;
	
	_Everything_Lock();
	
	if (_Everything_List)
	{
		if (nIndex < 0)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L"");
			
			goto exit;
		}
		
		if (nIndex >= (int)((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L"");
			
			goto exit;
		}

		len = 0;
		
		if (_Everything_IsUnicodeQuery)		
		{
			len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex]));
		}
		else
		{
			len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]));
		}
			
		if (len)
		{
			len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,L"\\");
		}

		if (_Everything_IsUnicodeQuery)		
		{
			len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex]));
		}
		else
		{
			len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]));
		}
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;

		len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L"");
	}

exit:

	_Everything_Unlock();
	
	return len;
}
Пример #29
0
int EVERYTHINGUSERAPI Everything_GetResultFullPathNameA(int nIndex,LPSTR buf,int bufsize)
{
	int len;
	
	_Everything_Lock();

	if (_Everything_List)
	{
		if (nIndex < 0)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			len = _Everything_CopyA(buf,bufsize,0,"");
			
			goto exit;
		}
		
		if (nIndex >= (int)((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems)
		{
			_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
			
			len = _Everything_CopyA(buf,bufsize,0,"");
			
			goto exit;
		}
		
		len = 0;
		
		if (_Everything_IsUnicodeQuery)		
		{
			len = _Everything_CopyAFromW(buf,bufsize,len,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex]));
		}
		else
		{
			len = _Everything_CopyA(buf,bufsize,len,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]));
		}
		
		if (len)
		{
			len = _Everything_CopyA(buf,bufsize,len,"\\");
		}

		if (_Everything_IsUnicodeQuery)		
		{
			len = _Everything_CopyAFromW(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex]));
		}
		else
		{
			len = _Everything_CopyA(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]));
		}
	}
	else
	{
		_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;

		len = _Everything_CopyA(buf,bufsize,0,"");
	}

exit:

	_Everything_Unlock();
	
	return len;
}