modified: pixi.toml
[GalaxyCodeBases.git] / etc / Windows / vlmcsd_old_vancepym / libkms-test.c
bloba808f03825a4de41478236185b2c6e4740f314bb
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
5 #include "libkms.h"
6 #include "kms.h"
7 #include "endian.h"
9 static const char ePID[] = { 'T', 0, 'E', 0, 'S', 0, 'T', 0, 0, 0 };
11 __stdcall BOOL KmsCallBack(const REQUEST *const baseRequest, RESPONSE *const baseResponse, BYTE *const hwId, const char* const ipstr)
13 printf("libvlmcs-test.c: Entered KmsCallBack for client %s\n", ipstr);
15 memcpy(&baseResponse->CMID, &baseRequest->CMID, sizeof(GUID));
16 memcpy(&baseResponse->ClientTime, &baseRequest->ClientTime, sizeof(FILETIME));
17 memcpy(&baseResponse->KmsPID, ePID, sizeof(ePID));
19 baseResponse->Version = baseRequest->Version;
20 baseResponse->Count = LE32(LE32(baseRequest->N_Policy) << 1);
21 baseResponse->PIDSize = sizeof(ePID);
22 baseResponse->VLActivationInterval = LE32(120);
23 baseResponse->VLRenewalInterval = LE32(10080);
25 if (hwId && baseResponse->MajorVer > 5) memcpy(hwId, "\x01\x02\x03\x04\x05\x06\x07\x08", 8);
27 return TRUE;
30 int main(int argc, char** argv)
32 printf("libvlmcs-test.c: Program start\n");
33 StartKmsServer(1688, KmsCallBack);
34 return 0;