Click here to Skip to main content
14,665,174 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
QuestionGroup policy editor api Pin
Member 1487268130-Aug-20 23:13
MemberMember 1487268130-Aug-20 23:13 
AnswerRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 1:27
mveRichard MacCutchan31-Aug-20 1:27 
QuestionRe: Group policy editor api Pin
Member 1487268131-Aug-20 17:08
MemberMember 1487268131-Aug-20 17:08 
AnswerRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 20:57
mveRichard MacCutchan31-Aug-20 20:57 
GeneralRe: Group policy editor api Pin
Member 1487268131-Aug-20 21:33
MemberMember 1487268131-Aug-20 21:33 
GeneralRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 21:40
mveRichard MacCutchan31-Aug-20 21:40 
AnswerRe: Group policy editor api Pin
Randor 1-Sep-20 23:24
professional Randor 1-Sep-20 23:24 
QuestionWindows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill30-Aug-20 12:01
Memberjackngill30-Aug-20 12:01 
To anyone who can help me Please?

I apologise in advance if my question seems confusing noobish but I have no clue about coding in C++ hence the apparent ignorance & difficulty to me (& for some it may be a very basic question). First of all I have these lines of code that I would like to amend slightly like so:
typedef DWORD(__stdcall *CPP) (DWORD param1, PWCHAR param2, DWORD param3);

void Disable_WFP() {
    hmod=LoadLibrary("sfc_os.dll");
    CPP SetSfcFileException;
    // the function is stored at the fifth ordinal in sfc_os.dll
    SetSfcFileException=(CPP)GetProcAddress(hmod,(LPCSTR)5);
    SetSfcFileException(0, L"c:\\windows\\system32\\calc.exe",-1);
    // Now we can modify the system file in a complete stealth.
}

It is not my code it belongs to Abdellatif_El_Khlifi & all credit belongs to him but I would like to make a small amendmant to his code but have no clue how to do this the alteration I would like to change this line:

SetSfcFileException(0, L"c:\\windows\\system32\\calc.exe",-1);

and alter to: (this is obviously not C++ but just trying to illustrate what I am trying to do)

SetSfcFileException(0, L"%SystemDrive%\\windows\\system32\\calc.exe",-1);

My question is there a equivelent C++ code for the SystemDrive variable & could someone re-code this to make the small amendmant Please to suit my needs? The reason is it will make the program more generic for me just in case say for instance my OS XP is installed on D:\\ drive instead of C:\\ drive. I have found this snippet of code that may be of help but have no clue as to how I would incorporate in the given scenario above. char *sysDrive = getenv ("SystemDrive"); or this
sysdrive = getenv("SYSTEMDRIVE");
    if (sysdrive == NULL || *sysdrive == NUL)
	sysdrive = "C:\\";
}

Best Regards,
Jackngill
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Mircea Neacsu30-Aug-20 16:47
MemberMircea Neacsu30-Aug-20 16:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill30-Aug-20 22:26
Memberjackngill30-Aug-20 22:26 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill2-Sep-20 22:48
Memberjackngill2-Sep-20 22:48 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 2:59
MemberDavid Crow3-Sep-20 2:59 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 4:01
Memberjackngill3-Sep-20 4:01 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 4:23
MemberDavid Crow3-Sep-20 4:23 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 6:41
MemberVictor Nijegorodov3-Sep-20 6:41 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 7:08
MemberDavid Crow3-Sep-20 7:08 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 7:47
MemberVictor Nijegorodov3-Sep-20 7:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 7:57
MemberDavid Crow3-Sep-20 7:57 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:04
MemberVictor Nijegorodov3-Sep-20 8:04 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 8:09
MemberDavid Crow3-Sep-20 8:09 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 9:27
MemberVictor Nijegorodov3-Sep-20 9:27 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:07
MemberVictor Nijegorodov3-Sep-20 8:07 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 7:47
MemberVictor Nijegorodov3-Sep-20 7:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 11:41
Memberjackngill3-Sep-20 11:41 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 22:29
MemberVictor Nijegorodov3-Sep-20 22:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.