Exemple #1
0
/*
 * ReadConfig - read the configuration information
 */
void ReadConfig( void )
{
    char        msgfilter[MFILTER_LAST_MSG - MFILTER_FIRST_MSG + 2];
    char        cbfilter[CFILTER_LAST_MSG - CFILTER_FIRST_MSG + 2];
    char        buf[10];
    WORD        i;

    GetConfigFilePath( iniPath, sizeof( iniPath ) );
    strcat( iniPath, "\\" WATCOM_INI );

    setGlobalDefault();
    SetTrackWndDefault();
    SetMainWndDefault();

    Monitoring[MON_SENT_IND] = GetPrivateProfileInt( SECT_NAME, MONSENT, TRUE, iniPath );
    Monitoring[MON_POST_IND] = GetPrivateProfileInt( SECT_NAME, MONPOST, TRUE, iniPath );
    Monitoring[MON_CB_IND] = GetPrivateProfileInt( SECT_NAME, MONCB, TRUE, iniPath );
    Monitoring[MON_STR_IND] = GetPrivateProfileInt( SECT_NAME, MONSTR, TRUE, iniPath );
    Monitoring[MON_ERR_IND] = GetPrivateProfileInt( SECT_NAME, MONERR, TRUE, iniPath );
    Monitoring[MON_LNK_IND] = GetPrivateProfileInt( SECT_NAME, MONLNK, TRUE, iniPath );
    Monitoring[MON_CONV_IND] = GetPrivateProfileInt( SECT_NAME, MONCONV, TRUE, iniPath );

    /* global settings */

    ConfigInfo.scroll = GetPrivateProfileInt( SECT_NAME, CFG_SCROLL,
                                              ConfigInfo.scroll, iniPath );
    ConfigInfo.alias = GetPrivateProfileInt( SECT_NAME, CFG_ALIAS,
                                             ConfigInfo.alias, iniPath );
    ConfigInfo.screen_out = GetPrivateProfileInt( SECT_NAME, CFG_SCREEN,
                                                  ConfigInfo.screen_out, iniPath );
    ConfigInfo.show_tb = GetPrivateProfileInt( SECT_NAME, CFG_SHOW_TB,
                                               ConfigInfo.show_tb, iniPath );
    ConfigInfo.show_hints = GetPrivateProfileInt( SECT_NAME, CFG_SHOW_HINTS,
                                                  ConfigInfo.show_hints, iniPath );
    ConfigInfo.on_top = GetPrivateProfileInt( SECT_NAME, CFG_ON_TOP,
                                              ConfigInfo.on_top, iniPath );

    /* window size/pos info */
    for( i = 0; i < NO_TRK_WND; i++ ) {
        itoa( i, buf, 10 );
        readWindowInfo( Tracking + i, buf );
    }
    readWindowInfo( &MainWndConfig, MAIN_WND_EXT );

    /* filter info */
    memset( msgfilter, '1', sizeof( msgfilter ) );
    msgfilter[MFILTER_LAST_MSG - MFILTER_FIRST_MSG + 1] = '\0';
    memset( cbfilter, '1', sizeof( cbfilter ) );
    cbfilter[CFILTER_LAST_MSG - CFILTER_FIRST_MSG + 1] = '\0';
    GetPrivateProfileString( SECT_NAME, MSGFLTER, msgfilter, msgfilter,
                             MFILTER_LAST_MSG - MFILTER_FIRST_MSG + 2, iniPath );
    GetPrivateProfileString( SECT_NAME, CBFLTER, cbfilter, cbfilter,
                             CFILTER_LAST_MSG - CFILTER_FIRST_MSG + 2, iniPath );
    SetFilter( msgfilter, cbfilter );

    /* logging info */
    LoadLogConfig( iniPath, SECT_NAME );
    InitMonoFont( SECT_NAME, iniPath, SYSTEM_FIXED_FONT, Instance );

} /* ReadConfig */
Exemple #2
0
	void CImageDict::LoadCCITT4(const wchar_t* wsTempFile, unsigned int unWidth, unsigned int unHeight)
	{
		CImageFileStream* pStream = new CImageFileStream();
		if (!pStream)
			return;

		pStream->OpenFile(wsTempFile);
		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("Height", unHeight);
		Add("Width", unWidth);
		Add("ColorSpace", "DeviceGray");
		Add("BitsPerComponent", 1);

		CArrayObject* pDecodeParams = new CArrayObject();
		CDictObject* pParams = new CDictObject();
		pDecodeParams->Add(pParams);
		pParams->Add("K", 0);
		pParams->Add("Columns", unWidth);
		pParams->Add("EncodedByteAlign", true);
		Add("DecodeParams", pDecodeParams);

		SetFilter(STREAM_FILTER_CCITT_DECODE);

	}
Exemple #3
0
void mi::Init(CMachineDataInput * const pi)
{
#ifndef _MSC_VER
    DSP_Init(pMasterInfo->SamplesPerSec);
#endif
	numTracks = 1;
	DryThru = true;

	for (int c = 0; c < MAX_TAPS; c++)
	{
		Tracks[c].Buffer = NULL;
		Tracks[c].Unit = UNIT_TICK;
		Tracks[c].Length = pMasterInfo->SamplesPerTick * 3;
		Tracks[c].Pos = 0;
		Tracks[c].Feedback = 0.3f;
		Tracks[c].WetOut = 0;
		Tracks[c].FilterType = 1;
		Tracks[c].FilterCutoff = 1000;
		Tracks[c].FilterBandwidth = 1000;
		
		DSP_BW_Reset(Tracks[c].Filter);
		SetFilter(Tracks[c]);
		
	}

	Tracks[0].WetOut = 0.3f;	// enable first track

	IdleMode = true;
	IdleCount = 0;
}
SystemHandleInformation::SystemHandleInformation( DWORD pID, BOOL bRefresh, LPCTSTR lpTypeFilter )
{
	m_processId = pID;
	
	// Set the filter
	SetFilter( lpTypeFilter, bRefresh );
}
Exemple #5
0
void ProtoXml::IterFinder::Reset(const char* filterPath)
{
    prev_elem = root_elem;
    if (NULL != filterPath)
        SetFilter(filterPath);
    IterFilterBase::Reset();
}  // end ProtoXml::IterFinder::Reset()
Exemple #6
0
int main(int argc, char *argv[])
{
    if (argc == 1) {
        printUsage();
        exit(1);
    }

    macConvert(argv[1], ServerMac);
    pcap_t* handler;

    //GetAddr();

    if (argc == 2) {
        handler = opev_devices("");
    } else {
        handler = opev_devices(argv[2]);
    }

    SetFilter(handler);
    main_loop(handler);

    
    

    return 0;
}
Exemple #7
0
    void CImageDict::LoadJpeg(const wchar_t* wsFilePath, unsigned int unWidth, unsigned int unHeight, bool bGrayScale)
	{
        BYTE* pCorrectBuffer = NULL;
        int nBufferSize = 0;
        NSImageReSaver::CorrectImage(wsFilePath, pCorrectBuffer, nBufferSize, unWidth, unHeight);

        if (pCorrectBuffer != NULL)
        {
            this->LoadJpeg(pCorrectBuffer, nBufferSize, unWidth, unHeight, bGrayScale);
            free(pCorrectBuffer);
            return;
        }


		CImageFileStream* pStream = new CImageFileStream();
		if (!pStream)
			return;

		pStream->OpenFile(wsFilePath);
		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("Height", unHeight);
		Add("Width", unWidth);

        if (bGrayScale)
            Add("ColorSpace", "DeviceGray");
        else
            Add("ColorSpace", "DeviceRGB");

		Add("BitsPerComponent", 8);
		SetFilter(STREAM_FILTER_DCT_DECODE);
	}
void
TextureImageTextureSourceOGL::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter)
{
  MOZ_ASSERT(mTexImage,
    "Trying to bind a TextureSource that does not have an underlying GL texture.");
  mTexImage->BindTexture(aTextureUnit);
  SetFilter(mCompositor->gl(), aFilter);
}
MaterialDataSortFilterProxModel::MaterialDataSortFilterProxModel (MaterialDataListModel* model, QObject* parent)
  : QSortFilterProxyModel(parent)
  , _model(model)
{

  setSourceModel(model);
  SetFilter("");
}
Exemple #10
0
void
StreamTextureSourceOGL::BindTexture(GLenum activetex, gfx::Filter aFilter)
{
    MOZ_ASSERT(gl());
    gl()->fActiveTexture(activetex);
    gl()->fBindTexture(mTextureTarget, mTextureHandle);
    SetFilter(gl(), aFilter);
}
Exemple #11
0
// Common initialization code, used by all constructors.
void STTexture::Initialize()
{
    mTexId = 0;
    glGenTextures(1, &mTexId);

    // Default filtering and addressing options:
    SetFilter(GL_LINEAR, GL_LINEAR);
    SetWrap(GL_CLAMP, GL_CLAMP);
}
EGwsStatus CGwsPreparedFeatureQuery::Execute (
    FdoFilter               * filter,
    IGWSFeatureIterator    ** results,
    bool                      bScrollable
)
{
    SetFilter (filter);
    return Execute (results,bScrollable);
}
Exemple #13
0
Texture::Texture(GLuint textureId, char* source, OBJECTTYPE type)
{
	Init();
	m_iID = textureId;
	m_type = type;
	BindTextureData(source);
	SetWrappingMode(GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE);
	SetFilter(GL_LINEAR, GL_LINEAR);
}
Exemple #14
0
FilteredStringBuilder::FilteredStringBuilder(StringBuilder *pBuilder, StringFilter *pFilter)
{
	mpBuilder = 0;
	mpFilter = 0;
	mpTempBuffer = 0;
	
	SetBuilder(pBuilder);
	SetFilter(pFilter);
}	
// the initialization method
void TSRGuiFileBrowser::Initialize()
{
    m_Maxcharacters = 10;
    m_eType = TWISTER_GUI_COMPONENT_FILEBROWSER;
    m_bClickable    = true;
    SetTextAlign( GUI_ALIGN_TOPLEFT );
    SetFilter( "*.*" );
    m_FolderColor.Assign( 1.0f, 0.0f, 0.0f );
    m_FileColor.Assign( 0.0f, 0.0f, 1.0f );
    m_HotColor.Assign( 0.5f, 0.5f, 0.5f );
}
Exemple #16
0
/*
 * enableSpy - turn on spying
 */
static void enableSpy( void )
{
    SetFilter( HandleMessageInst );
    EnableMenuItem( SpyMenu, SPY_ADD_WINDOW, MF_ENABLED );
    EnableMenuItem( SpyMenu, SPY_STOP, MF_ENABLED );
    ClearMessageCount();
    CheckMenuItem( SpyMenu, SPY_ALL_WINDOWS, MF_UNCHECKED );
    spyAll = FALSE;
    SetSpyState( ON );

} /* enableSpy */
AutoTextControl::AutoTextControl(const char* name, const char* label,
	const char* text, BMessage* msg, uint32 flags)
	:
	BTextControl(name, label, text, msg, flags),
	fEmpty(false),
	fOnlyDigits(false),
 	fFilter(NULL),
 	fCharLimit(0)
{
	SetFilter(new AutoTextControlFilter(this));
}
Exemple #18
0
    CTexture::CTexture(glm::uvec2 const & size, TextureFormat const format) 
      : mId(0) 
      , mSize(size)
    {
      glGenTextures(1, &mId);

      glBindTexture(GL_TEXTURE_2D, mId);
      glTexImage2D(GL_TEXTURE_2D, 0, static_cast<GLint>(format), mSize.x, mSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
      CB_GL_CHECKERRORS();
      glBindTexture(GL_TEXTURE_2D, 0);

      SetFilter(TextureFilter::LINEAR, TextureFilter::LINEAR, TextureFilter::LINEAR);
      SetWrap(TextureWrap::CLAMP_TO_EDGE, TextureWrap::CLAMP_TO_EDGE);
    }
Exemple #19
0
Stockpile::Stockpile(seed::View* pView, int x, int y)
    : m_pView(pView)
{
    SetPosition(Vector2((float)x + 1.f, (float)y + .5f));
    auto pStockpileSprite = m_pView->CreateSprite("stockpile.png");
    pStockpileSprite->SetScale(Vector2(SPRITE_SCALE));
    pStockpileSprite->SetFilter(onut::SpriteBatch::eFiltering::Nearest);
    pStockpileSprite->SetAlign(Vector2::Zero);
    pStockpileSprite->SetPosition(Vector2(-2 - 16, -7 - 16 + 8) * SPRITE_SCALE);
    Attach(pStockpileSprite);

    m_pRockSprite = m_pView->CreateSprite("carryRock.png");
    m_pRockSprite->SetScale(Vector2(.65f));
    m_pRockSprite->SetFilter(onut::SpriteBatch::eFiltering::Nearest);
    m_pRockSprite->SetPosition(Vector2(8, 4));
    pStockpileSprite->Attach(m_pRockSprite);

    m_pRockText = m_pView->CreateSpriteString("font.fnt");
    m_pRockText->SetCaption("00");
    m_pRockText->SetScale(Vector2(.5f));
    m_pRockText->SetColor(Color::Black);
    m_pRockText->SetFilter(onut::SpriteBatch::eFiltering::Nearest);
    m_pRockText->SetPosition(Vector2(16, 4));
    pStockpileSprite->Attach(m_pRockText);

    m_pWoodSprite = m_pView->CreateSprite("woodCarryH.png");
    m_pWoodSprite->SetScale(Vector2(.65f));
    m_pWoodSprite->SetFilter(onut::SpriteBatch::eFiltering::Nearest);
    m_pWoodSprite->SetPosition(Vector2(22, 4));
    pStockpileSprite->Attach(m_pWoodSprite);

    m_pWoodText = m_pView->CreateSpriteString("font.fnt");
    m_pWoodText->SetCaption("00");
    m_pWoodText->SetScale(Vector2(.5f));
    m_pWoodText->SetColor(Color::Black);
    m_pWoodText->SetFilter(onut::SpriteBatch::eFiltering::Nearest);
    m_pWoodText->SetPosition(Vector2(28, 4));
    pStockpileSprite->Attach(m_pWoodText);

    auto pTile = g_gameView->GetTileAt(x, y);
    if (pTile) pTile->isOccupied = true;
    pTile = g_gameView->GetTileAt(x + 1, y);
    if (pTile) pTile->isOccupied = true;

    pView->CreateBoxPhysicsForNode(this, true);

    lightEnabled = true;
    lightRadius = 3.f;
    lightColor = Color::White * .5f;
}
Exemple #20
0
	void CImageDict::LoadRaw(const BYTE* pBuffer, unsigned int unSize, unsigned int unWidth, unsigned int unHeight)
	{
		CMemoryStream* pStream = new CMemoryStream(unSize);
		if (!pStream)
			return;
		pStream->Write(pBuffer, unSize);
		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("ColorSpace", "DeviceRGB");
		Add("Width", unWidth);
		Add("Height", unHeight);
		Add("BitsPerComponent", 8);
		SetFilter(STREAM_FILTER_FLATE_DECODE);
	}
Exemple #21
0
	void CImageDict::LoadJb2(const wchar_t* wsFilePath, unsigned int unWidth, unsigned int unHeight)
	{
		CImageFileStream* pStream = new CImageFileStream();
		if (!pStream)
			return;

		pStream->OpenFile(wsFilePath);
		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("Height", unHeight);
		Add("Width", unWidth);
		Add("ColorSpace", "DeviceGray");
		Add("BitsPerComponent", 1);
		SetFilter(STREAM_FILTER_JBIG2_DECODE);
	}
CurrencyBox::CurrencyBox(const char *name, const char *label,
			const char *text, BMessage *msg, uint32 flags)
 : NavTextBox(name,label,text,msg,flags)
{
	SetFilter(new CurrencyBoxFilter(this));

	const char amount_disallowed[]=" `~!@#%^&*()_-+=QWERTYUIOP{[}]|\\ASDFGHJKL;:'\""
								"ZXCVBNM<>?/qwertyuiopasdfghjklzxcvbnm";
	int32 i=0;
	while(amount_disallowed[i])
	{
		TextView()->DisallowChar(amount_disallowed[i]);
		i++;
	}
	SetCharacterLimit(20);
}
                        ODSPropPath :: ODSPropPath (const ODSPropPath &rcODSPropPath )
                     :   path(NULL),
  struct_name(NULL),
  order(NULL),
  filter(NULL),
  acc_mode(PI_undefined),
  type(PT_undefined),
  collection(NO),
  selection(NO)
{

  SetPath(rcODSPropPath);
  SetAccessMode(rcODSPropPath.acc_mode);
  SetCollection(rcODSPropPath.collection);
  SetFilter(rcODSPropPath.filter,rcODSPropPath.selection);

}
Exemple #24
0
NTSTATUS CUsbDkFilterDeviceInit::Configure(ULONG InstanceNumber)
{
    PAGED_CODE();

    WDF_OBJECT_ATTRIBUTES requestAttributes;
    WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&requestAttributes, WDF_REQUEST_CONTEXT);
    requestAttributes.ContextSizeOverride = CUsbDkFilterDevice::CStrategist::GetRequestContextSize();

    SetRequestAttributes(requestAttributes);
    SetFilter();

    CString DeviceName;
    auto status = DeviceName.Create(TEXT("\\Device\\UsbDkFilter"), InstanceNumber);
    if (!NT_SUCCESS(status))
    {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_FILTERDEVICE, "%!FUNC! Failed to allocate filter device name (%!STATUS!)", status);
        return status;
    }

    status = SetName(*DeviceName);
    if (!NT_SUCCESS(status))
    {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_FILTERDEVICE, "%!FUNC! SetName failed %!STATUS!", status);
        return status;
    }

    SetPowerCallbacks([](_In_ WDFDEVICE Device)
                      { return Strategy(Device)->MakeAvailable(); });

    SetIoInCallerContextCallback([](_In_ WDFDEVICE Device, WDFREQUEST  Request)
                                 { return Strategy(Device)->IoInCallerContext(Device, Request); });

    SetFileEventCallbacks(WDF_NO_EVENT_CALLBACK,
                          [](_In_ WDFFILEOBJECT FileObject)
                          {
                                WDFDEVICE Device = WdfFileObjectGetDevice(FileObject);
                                Strategy(Device)->OnClose();
                          },
                          WDF_NO_EVENT_CALLBACK);

    status = SetPreprocessCallback([](_In_ WDFDEVICE Device, _Inout_  PIRP Irp)
                                        { return Strategy(Device)->PNPPreProcess(Irp); },
                                        IRP_MJ_PNP);

    return status;
}
Exemple #25
0
EGwsStatus CGwsPreparedJoinQuery::Execute (
    FdoFilter            * filter,
    IGWSFeatureIterator ** results,
    bool                   bScrollable
)
{
    EGwsStatus                 stat = eGwsOk;

    try   {
        eGwsOkThrow (SetFilter (filter));
        return Execute (results,bScrollable);

    } catch (EGwsStatus es) {
        PushStatus (es);
        stat = es;
    }
    return stat;
}
Exemple #26
0
    void CImageDict::LoadBW(NSImages::CPixJbig2* pPix, unsigned int unWidth, unsigned int unHeight)
	{
		SetStream(m_pXref, new CMemoryStream());
		CJbig2Global* pJbig2Global = m_pDocument->GetJbig2Global();
		pJbig2Global->AddImage(pPix, GetStream());

		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("Height", unHeight);
		Add("Width", unWidth);
		Add("ColorSpace", "DeviceGray");
		Add("BitsPerComponent", 1);
		SetFilter(STREAM_FILTER_JBIG2_DECODE);

		CArrayObject* pDecodeParams = new CArrayObject();
		CDictObject* pParams = new CDictObject();
		pDecodeParams->Add(pParams);
		pParams->Add("JBIG2Globals", pJbig2Global);
		Add("DecodeParms", pDecodeParams);
	}
Exemple #27
0
	void CImageDict::LoadRaw(const BYTE* pBgra, unsigned int unWidth, unsigned int unHeight)
	{
		CMemoryStream* pStream = new CMemoryStream(3 * unWidth * unHeight);
		if (!pStream)
			return;

		for (unsigned int unIndex = 0, unSize = 4 * unWidth * unHeight; unIndex < unSize; unIndex += 4)
		{
			pStream->Write(pBgra + unIndex, 3);
		}

		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("ColorSpace", "DeviceRGB");
		Add("Width", unWidth);
		Add("Height", unHeight);
		Add("BitsPerComponent", 8);
		SetFilter(STREAM_FILTER_FLATE_DECODE);
	}
Exemple #28
0
    void CImageDict::LoadJpeg(BYTE* pBuffer, int nBufferSize, unsigned int unWidth, unsigned int unHeight, bool bGrayScale)
	{
		CMemoryStream* pStream = new CMemoryStream();
		if (!pStream)
			return;

		pStream->Write(pBuffer, nBufferSize);
		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("Height", unHeight);
		Add("Width", unWidth);

        if (bGrayScale)
            Add("ColorSpace", "DeviceGray");
        else
            Add("ColorSpace", "DeviceRGB");

        Add("BitsPerComponent", 8);
		SetFilter(STREAM_FILTER_DCT_DECODE);
	}
Exemple #29
0
static void doSpyAll( HWND hwnd, BOOL state ) {

    char        *rcstr;
    char        tmp[32];

    if( !state ) {
        SendMessage( hwnd, WM_COMMAND, GET_WM_COMMAND_MPS( SPY_STOP, 0, 0 ) );
    }  else {
        spyAll = state;
        EnableMenuItem( SpyMenu, SPY_STOP, MF_ENABLED );
        CheckMenuItem( SpyMenu, SPY_ALL_WINDOWS, MF_CHECKED );
        SetFilter( HandleMessageInst );
        ClearSelectedWindows();
        if( SpyState == NEITHER ) {
            ClearMessageCount();
        }
        rcstr = GetRCString( STR_ALL_WIN_TITLE );
        sprintf( tmp, rcstr, SpyName );
        SetWindowText( hwnd, tmp );
        EnableMenuItem( SpyMenu, SPY_ADD_WINDOW, MF_GRAYED );
    }
}
Exemple #30
0
void AD::Enumerate(ADSearchFilter searchFilter)
{
    LDAPMessage *search = NULL;
    LDAPMessage *entry = NULL;
    PWCHAR *value;
    PWCHAR attribute;
    berval *ber = NULL;
    DWORD i;
    DWORD j;
    // 20 strings should be enough?
    LPWSTR filters[20];
    BerElement *berElement = NULL;

    // Fill our filters array (NULL-terminated) with search-specific filters.
    switch(searchFilter)
    {
    case AD_SEARCH_USER:
        SetFilter(L"(&(objectClass=user)(objectCategory=person))");
        filters[0] = L"samAccountName";
        filters[1] = L"cn";
        filters[2] = L"homeDirectory";
        filters[3] = L"memberOf";
        filters[4] = NULL;
        break;
    case AD_SEARCH_GROUP:
        SetFilter(L"(&(objectCategory=group))");
        filters[0] = L"samAccountName";
        filters[1] = L"cn";
        filters[2] = L"member";
        filters[3] = NULL;
        break;
    case AD_SEARCH_MACHINE:
        SetFilter(L"(&(objectCategory=computer))");
        filters[0] = L"samAccountName";
        filters[1] = L"cn";
        filters[2] = NULL;
        break;
    default:
        break;
    }

    if(ldap_search_s(ldap, (const PWCHAR)dn.c_str(), LDAP_SCOPE_SUBTREE, (PWCHAR)filter.c_str(), NULL, 0, &search) != LDAP_SUCCESS)
    {
        Util::Error(LdapGetLastError(), L"ldap_search");
        Util::Notice(L"ret = %x\n", LdapGetLastError());
    }

    switch(searchFilter)
    {
    case AD_SEARCH_USER:
        AddUsers(search);
        break;
    case AD_SEARCH_GROUP:
        AddGroups(search);
        break;
    case AD_SEARCH_MACHINE:
        AddServers(search);
        break;
    default:
        break;
    }
    ldap_msgfree(search);
    ber_free(berElement, 0);
}