English
Source / code snippets

groups lists Lokaler procedure Prozedursammlung

 
Globale reaches and Definitionen should into File

GLOBALE_DEFS.INC
CompileMarkSeparation
Declare GU_BUFFER_P#,GU_BUFFER_A#,GU_BUFFER#,Entry_COUNT#
Declare GETERROR_Buffer
e>

procedure with demonstration
CompileMarkSeparation
************** Start der Prozedur zum Listen lokaler Gruppen ********************

PROC Liste_Lokale_Gruppen

    Clearlist
    Declare Indexzähler&,NT_Fehler&,E_READ&,E_TOTAL&,resumehandle&
    DIM Entry_COUNT#,4
    DIM GU_BUFFER_P#,4
    DIM GU_BUFFER_A#,252
    DIM GU_BUFFER#,32
    LET NT_Fehler&=$EA
    LET Resumehandle&=0
    LET Indexzähler&=0

    While NT_Fehler&=$EA

        Clear Entry_COUNT#,GU_BUFFER_P#,GU_BUFFER_A#,GU_BUFFER#
        LET NT_Fehler&=@EXTERNAL("Netapi32.DLL","NetLocalGroupEnum",0,0,GU_BUFFER_P#,-1,@ADDR(E_READ&),@ADDR(E_TOTAL&),@ADDR(Resumehandle&))

        IF @or(NT_Fehler&=$EA,NT_Fehler&=0)

            While Indexzähler&<E_READ&

                @EXTERNAL("KERNEL32.DLL","RtlMoveMemory",GU_BUFFER#,@Long(GU_BUFFER_P#,0)+Indexzähler&*4,4)
                @EXTERNAL("KERNEL32.DLL","WideCharToMultiByte",0,0,@Long(GU_BUFFER#,0),-1,GU_BUFFER_A#,261,0,0)
                Addstring @String$(GU_BUFFER_A#,0)
                LET INDEXZÄHLER&=INDEXZÄHLER&+1

            wend

            @External("Netapi32.DLL","NetApiBufferFree",@Long(GU_BUFFER_P#,0))

        endif

    wend

    IF NT_Fehler&<>0

        DIM GETERROR_Buffer#,32000
        @External("KERNEL32","FormatMessageA",$1000,0,NT_Fehler&,0,GETERROR_Buffer#,32000,0)
        Let GETERROR_Buffer$=@STRING$(GETERROR_Buffer#,0)
        Dispose GETERROR_Buffer#
        @messagebox(GETERROR_Buffer$,"Ein Fehler ist aufgetreten!",16)

    endif

    Dispose Entry_COUNT#
    Dispose GU_BUFFER#
    Dispose GU_BUFFER_A#
    Dispose GU_BUFFER#

endproc

************** Ende der Prozedur zum Listen lokaler Gruppen ********************
 $I GLOBALE_DEFS.INC
Declare GU_LISTE&
Windowstyle 31
Windowtitle "Lokale Gruppen listen"
Window 0,0-640,440
LET GU_LISTE&=@CREATECHOICEBOX(%HWND,"",10,100,200,200)
Liste_Lokale_Gruppen
@MoveListToChoice(GU_LISTE&)

While 0=0

    Waitinput

=s4 href='./../../Function-References/XProfan/wend/'>Wend

 
08/17/05  
 




CompileMarkSeparation
************** lokale_Gruppen_listen.INC **************
************** Start der Prozedur zum Ermitteln lokaler Gruppen ********************

Proc Liste_lokale_Gruppen

    Clearlist
    Declare Indexzähler&,Nt_fehler&,E_read&,E_total&,Resumehandle&
    Dim Entry_count#,4
    Dim Gu_buffer_p#,4
    Dim Gu_buffer_a#,252
    Dim Gu_buffer#,32
    Let Nt_fehler&=$Ea
    Let Resumehandle&=0
    Let Indexzähler&=0

    While Nt_fehler&=$Ea

        Clear Entry_count#,Gu_buffer_p#,Gu_buffer_a#,Gu_buffer#
        Let Nt_fehler&=@External("Netapi32.DLL","NetLocalGroupEnum",0,0,Gu_buffer_p#,-1,@Addr(E_read&),@Addr(E_total&),@Addr(Resumehandle&))

        If @Or(Nt_fehler&=$Ea,Nt_fehler&=0)

            While Indexzähler&<E_read&

                @External("KERNEL32.DLL","RtlMoveMemory",Gu_buffer#,@Long(Gu_buffer_p#,0)+Indexzähler&*4,4)
                @External("KERNEL32.DLL","WideCharToMultiByte",0,0,@Long(Gu_buffer#,0),-1,Gu_buffer_a#,261,0,0)
                Addstring @String$(Gu_buffer_a#,0)
                Let IndexzÄhler&=IndexzÄhler&+1

            Wend

            @External("Netapi32.DLL","NetApiBufferFree",@Long(Gu_buffer_p#,0))

        Endif

    Wend

    If Nt_fehler&<>0

        Dim Geterror_buffer#,32000
        @External("KERNEL32","FormatMessageA",$1000,0,Nt_fehler&,0,Geterror_buffer#,32000,0)
        Let Geterror_buffer$=@String$(Geterror_buffer#,0)
        Dispose Geterror_buffer#
        @Messagebox(Geterror_buffer$,"Ein Fehler ist aufgetreten!",16)

    Endif

    Dispose Entry_count#
    Dispose Gu_buffer#
    Dispose Gu_buffer_a#
    Dispose Gu_buffer#
    Dispose Gu_buffer_p#

Endproc

************** Ende der Prozedur zum Ermitteln lokaler Gruppen *****************on>**
 
08/21/05  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.312 Views

Untitledvor 0 min.
W.L.06/06/17

Themeninformationen

this Topic has 1 subscriber:

unbekannt (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie