kapiaba Posted May 29, 2014 Report Share Posted May 29, 2014 Galera avançada, dá para me dar uma explicação geral aqui nestas funções? DBINFO() http://www.itlnet.net/programming/program/reference/c53g01c/ng28fbc.html DBORDERINFO() http://www.itlnet.net/programming/program/reference/c53g01c/ng2a6f6.html dbinfo.ch https://github.com/vszakats/harbour-core/blob/master/include/dbinfo.ch Veja o porquê da pergunta: http://forums.fivetechsupport.com/viewtopic.php?f=6&t=28524 Não entendi o que faz a função que o Liñares postou. Obg. abs. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 29, 2014 Author Report Share Posted May 29, 2014 Para aquellos de vosotros que aún tengais este problema de lentitud, aqui teneis una función muy simple que puede ayudar mucho: function TurnShared( lOnOff ) return dbInfo( DBI_SHARED, lOnOff ) ó simplemente llamar a dbInfo( DBI_SHARED, .F. ) Os agradezco vuestros comentarios con los resultados de esta función. Su comportamiento es similar a cmxShared() regards, saludos Antonio Linares www.fivetechsoft.com Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 30, 2014 Author Report Share Posted May 30, 2014 Alguém, pode me explicar o que significa SMB2 e como desativar? Obg. abs. Quote Link to comment Share on other sites More sharing options...
Eduardo Bilato Posted May 30, 2014 Report Share Posted May 30, 2014 Boa tarde Kapi Deixe que o DeathWing explique pra você o que é o SMB http://www.halfling.com.br/samba/o-protocolo-smb.html Para habilitar / desabilitar, veja esse link http://support.microsoft.com/kb/2696547/pt-br Quote Link to comment Share on other sites More sharing options...
kapiaba Posted June 2, 2014 Author Report Share Posted June 2, 2014 Função para desativar o SMB, by Rafa Carmona -> rafa.thefull@gmail.com #define HKEY_LOCAL_MACHINE 2147483650 //---------------------------------------------------------------------------// function SmbOff() LOCAL oReg, cName, uVar oReg := TReg32():Create( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters" ) // Call Set with an empty string to access the default key oReg:Set( "FileInfoCacheLifetime", 0 ) oReg:Set( "FileNotFoundCacheLifetime", 0 ) oReg:Set( "DirectoryCacheLifetime", 0 ) oReg:Close() oReg := TReg32():Create( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" ) // Call Set with an empty string to access the default key oReg:Set( "Smb2", 0 ) oReg:Close() Alert( "Windows registry updated!" ) return nil http://forums.fivetechsupport.com/viewtopic.php?f=6&t=28524&start=15 Quem puder testar e reportar, eu agradeço. abs. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted June 2, 2014 Author Report Share Posted June 2, 2014 Função nativa do harbour, não sei se funciona em xHarbour: FUNCTION win_osNetRegOk( lSetIt, lDoVista ) LOCAL bRetVal := .T. LOCAL cKeySrv LOCAL cKeyWks hb_default( @lSetIt, .F. ) hb_default( @lDoVista, .T. ) IF ! lDoVista .AND. hb_osIsWinVista() /* do nothing */ ELSEIF hb_osIsWin9x() bRetVal := win_regQuery( WIN_HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Services\VxD\VREDIR", "DiscardCacheOnOpen", 1, lSetIt ) ELSE cKeySrv := "System\CurrentControlSet\Services\LanmanServer\Parameters" cKeyWks := "System\CurrentControlSet\Services\LanmanWorkStation\Parameters" IF lSetIt lSetIt := ! hb_osIsWinNT() .OR. wapi_IsUserAnAdmin() ENDIF /* Server settings */ bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "CachedOpenLimit", 0, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "EnableOpLocks", 0, lSetIt ) /* Q124916 */ bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "EnableOpLockForceClose", 1, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "SharingViolationDelay", 0, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "SharingViolationRetries", 0, lSetIt ) IF hb_osIsWinVista() /* If SMB2 is enabled turning off oplocks does not work, so SMB2 is required to be turned off on Server. */ bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "SMB2", 0, lSetIt ) ENDIF /* Workstation settings */ bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "UseOpportunisticLocking", 0, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "EnableOpLocks", 0, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "EnableOpLockForceClose", 1, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "UtilizeNtCaching", 0, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "UseLockReadUnlock", 0, lSetIt ) IF hb_osIsWinVista() bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "FileInfoCacheLifetime", 0, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "FileNotFoundCacheLifetime", 0, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "DirectoryCacheLifetime", 0, lSetIt ) ENDIF IF hb_osIsWin2K() bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Services\MRXSmb\Parameters", "OpLocksDisabled", 1, lSetIt ) ENDIF ENDIF RETURN bRetVal http://forums.fivetechsupport.com/viewtopic.php?f=6&t=28524&start=15 abs, Quote Link to comment Share on other sites More sharing options...
emotta Posted June 2, 2014 Report Share Posted June 2, 2014 qual a vantagem de ativar e desativar o SMB? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted June 2, 2014 Author Report Share Posted June 2, 2014 Eduardo, se eu entendi: Experiencias de RDDs lentosAumenta a velocidade de abertura do banco de dados... Por exemplo: Me reportaram aqui, que Servidor Linux, com terminais rWindows, a abertura dos bancos ficam uma carroça. abs, Quote Link to comment Share on other sites More sharing options...
emotta Posted June 2, 2014 Report Share Posted June 2, 2014 Ótimo.... obrigado ! kapiaba 1 Quote Link to comment Share on other sites More sharing options...
SAOliveira Posted June 2, 2014 Report Share Posted June 2, 2014 Para uma maquina Windows, acessar dados em um Servido LINUX, é preciso estar com o samba rodando e startado pelo smb.conf Tipo assim, uma rede de maquinas Windows devem estar no mesmo grupo de trabalho para que o desempenho seja satisfatório. O samba ativo e rodando, o servidor Linux será visto na rede Windows. Alguns parâmetros devem ser analisados e colocados em pratica no LINUX. Se tudo estiver correto, a rede Linux/Windows é imbatível. Outra coisa, apesar de Linux Desck poder ativar o Samba, isto nunca é aconselhável , recomenda-se instalar Linux SERVER, pelo mesmo princípio que se usa Windows Server. kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted June 3, 2014 Author Report Share Posted June 3, 2014 Para uma maquina Windows, acessar dados em um Servido LINUX, é preciso estar com o samba rodando e startado pelo smb.conf Tipo assim, uma rede de maquinas Windows devem estar no mesmo grupo de trabalho para que o desempenho seja satisfatório. O samba ativo e rodando, o servidor Linux será visto na rede Windows. Alguns parâmetros devem ser analisados e colocados em pratica no LINUX. Se tudo estiver correto, a rede Linux/Windows é imbatível. Outra coisa, apesar de Linux Desck poder ativar o Samba, isto nunca é aconselhável , recomenda-se instalar Linux SERVER, pelo mesmo princípio que se usa Windows Server. Obrigado Sérgio, vou passar esta informação para a área técnica. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted June 3, 2014 Author Report Share Posted June 3, 2014 Sinceramente, não entendi porque o Liñares disse que esta função, aumenta a velocidade de abertura dos bancos de dados?? Ou estou fazendo algo errado? #include "FiveWin.ch" #include "DbInfo.ch" ANNOUNCE RDDSYS REQUEST DBFCDX, DBFFPT ANNOUNCE FPTCDX STATIC lOnOff := .F. FUNCTION MAIN() RDDSETDEFAULT("DBFCDX") USE TEST //HAS NO MEMO FIELD INDEX ON Field->ONE TO TEST CLOSE DATABASES USE TEST INDEX TEST ALIAS TEST SHARED NEW ? DBInfo( DBI_FILEHANDLE ) //OK ? DBInfo( DBI_MEMOHANDLE ) //HANGS HERE // ? "OK" IF TurnShared( lOnOff ) // se Shared = Retorna .T. ? [Shared] ELSE // Retorna .F. ? [Not Shared] ENDIF QUIT RETURN NIL function TurnShared( lOnOff ) return dbInfo( DBI_SHARED, lOnOff ) Abs, Quote Link to comment Share on other sites More sharing options...
kapiaba Posted June 4, 2014 Author Report Share Posted June 4, 2014 Alguém me ajuda aqui, com windows 7 e windows 8? #include "FiveWin.ch" function Main() If !WIN_OSNETREGOK() //Precisa direitos ADM If !WIN_OSNETREGOK(.t.,.t.) //primeiro .t. é para ajustar XP/W98..., o segundo ajusta no vista. MsgInfo('Registro do windows não ajustado !') EndIf EndIf RETURN NIL #include "common.ch" #include "directry.ch" #define WIN_HKEY_LOCAL_MACHINE 0 #define WIN_HKEY_CLASSES_ROOT 1 #define WIN_HKEY_CURRENT_USER 2 #define WIN_HKEY_CURRENT_CONFIG 3 #define WIN_HKEY_LOCAL_MACHINE 4 #define WIN_HKEY_USERS 5 /* NOTE: To change any of these registry settings Administrator rights are required by default in Windows. [vszakats] */ FUNCTION WIN_OSNETREGOK( lSetIt, lDoVista ) LOCAL bRetVal := .T. LOCAL cKeySrv LOCAL cKeyWks IF ! ISLOGICAL( lSetIt ) lSetIt := .F. ENDIF IF ! ISLOGICAL( lDoVista ) lDoVista := .T. ENDIF IF ! lDoVista .AND. Os_IsWinVISTA() //win_osIsVistaOrUpper() /* do nothing */ ELSEIF Os_IsWin9X() // hb_osIsWin9x() bRetVal := QueryRegistry( WIN_HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Services\VxD\VREDIR", "DiscardCacheOnOpen", 1, lSetIt ) ELSE cKeySrv := "System\CurrentControlSet\Services\LanmanServer\Parameters" cKeyWks := "System\CurrentControlSet\Services\LanmanWorkStation\Parameters" IF lSetIt lSetIt := ! Os_IsWinNT() .OR. os_IsUserAnAdmin() //wapi_IsUserAnAdmin() ENDIF /* Server settings */ bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "CachedOpenLimit", 0, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "EnableOpLocks", 0, lSetIt ) /* Q124916 */ bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "EnableOpLockForceClose", 1, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "SharingViolationDelay", 0, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "SharingViolationRetries", 0, lSetIt ) IF Os_IsWinVISTA() // win_osIsVistaOrUpper() /* If SMB2 is enabled turning off oplocks does not work, so SMB2 is required to be turned off on Server. */ bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeySrv, "SMB2", 0, lSetIt ) ENDIF /* Workstation settings */ bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "UseOpportunisticLocking", 0, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "EnableOpLocks", 0, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "EnableOpLockForceClose", 1, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "UtilizeNtCaching", 0, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "UseLockReadUnlock", 0, lSetIt ) IF Os_IsWinVISTA() //win_osIsVistaOrUpper() bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "FileInfoCacheLifetime", 0, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "FileNotFoundCacheLifetime", 0, lSetIt ) bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "DirectoryCacheLifetime", 0, lSetIt ) ENDIF IF Os_IsWinNT() //hb_osIsWin2K() bRetVal := bRetVal .AND. QueryRegistry( WIN_HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Services\MRXSmb\Parameters", "OpLocksDisabled", 1, lSetIt ) ENDIF // Gracias Lucas, mi duda major és aqui: IF Os_IsWin7() //hb_osIsWin7() bRetVal := bRetVal ... ??? Entende? ENDIF IF Os_IsWin8() //hb_osIsWin8() ENDIF ENDIF RETURN bRetVal FUNCTION WIN_OSNETVREDIROK( /* @ */ nResult ) LOCAL aFiles nResult := 0 IF Os_IsWin9X() // hb_osIsWin9x() aFiles := Directory( GetEnv( "WINDIR", "C:\WINDOWS" ) + "\SYSTEM\VREDIR.VXD" ) /* Check for faulty files. */ IF ! Empty( aFiles ) IF aFiles[ 1 ][ F_SIZE ] == 156749 .AND. aFiles[ 1 ][ F_TIME ] == "11:11:10" nResult := 1111 ELSEIF aFiles[ 1 ][ F_SIZE ] == 140343 .AND. aFiles[ 1 ][ F_TIME ] == "09:50:00" nResult := 950 ENDIF ENDIF ENDIF RETURN Empty( nResult ) #pragma BEGINDUMP #include <windows.h> HB_FUNC( OS_ISUSERANADMIN ) { BOOL b; SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; PSID AdministratorsGroup; b = AllocateAndInitializeSid( &NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup ); if( b ) { if ( !CheckTokenMembership( NULL, AdministratorsGroup, &b ) ) b = FALSE; FreeSid( AdministratorsGroup ); } hb_retl( b ); } #pragma ENDDUMP Quote Link to comment Share on other sites More sharing options...
kapiaba Posted June 9, 2014 Author Report Share Posted June 9, 2014 Desativando o UAC via programação, alguém pode testar? Meu computador foi para o técnico. By Rochinha. http://www.pctoledo.com.br/forum/viewtopic.php?f=4&t=14269&p=83330&hilit=treg32#p83330 Obg. abs. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 9, 2015 Author Report Share Posted April 9, 2015 Aferra, não notei pohhanenhuma de diferença com isso. kkkkkkkkkkkkkkkk Quote Link to comment Share on other sites More sharing options...
aferra Posted April 9, 2015 Report Share Posted April 9, 2015 Realmente em algumas redes não acontece nada...mas por exemplo em minha rede melhorou, em uma rede de cliente nada aconteceu....eu outro cliente todas formatadas começando do zero lá resolveu...então não consegui fazer referencia sobre isso...não sei explicar o motivo...em algumas redes o trem deixa mais rápido e em outras não...talvez seja windows...rsrs kapiaba 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.