wmi-1.3.16 from opsview.com

This commit is contained in:
Are Casilla
2019-02-16 00:16:52 +01:00
parent 163fdd3d1b
commit 17b3af2911
2146 changed files with 678824 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
INCLUDES=-I.
CFLAGS=$(INCLUDES)
all: npecho_client.exe npecho_server.exe
CC = i586-mingw32msvc-gcc
.SUFFIXES: .c .obj
.c.obj:
$(CC) $(CFLAGS) -c $< -o $@
clean:
del *~ *.obj *.exe
npecho_client.exe: npecho_client.obj
npecho_server.exe: npecho_server.obj
%.exe:
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
+13
View File
@@ -0,0 +1,13 @@
INCLUDES=-I
CFLAGS=$(INCLUDES) -Zi -nologo
all: npecho_client.exe npecho_server.exe
clean:
del *~ *.obj *.exe
npecho_client.exe: npecho_client.obj
$(CC) $(CFLAGS) -o npecho_client.exe npecho_client.obj $(LIBS)
npecho_server.exe: npecho_server.obj
$(CC) $(CFLAGS) -o npecho_server.exe npecho_server.obj $(LIBS)
+50
View File
@@ -0,0 +1,50 @@
/*
* Simple Named Pipe Client
* (C) 2005 Jelmer Vernooij <jelmer@samba.org>
* Published to the public domain
*/
#include <windows.h>
#include <stdio.h>
#define ECHODATA "Black Dog"
int main(int argc, char *argv[])
{
HANDLE h;
DWORD numread = 0;
char *outbuffer = malloc(strlen(ECHODATA));
if (argc == 1) {
printf("Usage: %s pipename\n", argv[0]);
printf(" Where pipename is something like \\\\servername\\NPECHO\n");
return -1;
}
h = CreateFile(argv[1], GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (h == INVALID_HANDLE_VALUE) {
printf("Error opening: %d\n", GetLastError());
return -1;
}
if (!WriteFile(h, ECHODATA, strlen(ECHODATA), &numread, NULL)) {
printf("Error writing: %d\n", GetLastError());
return -1;
}
if (!ReadFile(h, outbuffer, strlen(ECHODATA), &numread, NULL)) {
printf("Error reading: %d\n", GetLastError());
return -1;
}
printf("Read: %s\n", outbuffer);
if (!TransactNamedPipe(h, ECHODATA, strlen(ECHODATA), outbuffer, strlen(ECHODATA), &numread, NULL)) {
printf("TransactNamedPipe failed: %d!\n", GetLastError());
return -1;
}
printf("Result: %s\n", outbuffer);
return 0;
}