Skip to content

Commit

Permalink
mobve SILOOBJECT_BASIC_INFORMATION to winapi
Browse files Browse the repository at this point in the history
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
(cherry picked from commit 6428d3d)
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
  • Loading branch information
qmuntal authored and kiashok committed Oct 30, 2024
1 parent bf52d58 commit 1550628
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
9 changes: 1 addition & 8 deletions internal/jobobject/jobobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,7 @@ func isJobSilo(h windows.Handle) bool {
// the call will fail if the job hasn't been upgraded to a silo so we can use this to tell when we open a job
// if it's a silo or not. We still need to define the struct layout as expected by Win32, else the struct
// alignment might be different and the call will fail.
type SILOOBJECT_BASIC_INFORMATION struct {
SiloID uint32
SiloParentID uint32
NumberOfProcesses uint32
IsInServerSilo bool
Reserved [3]uint8
}
var siloInfo SILOOBJECT_BASIC_INFORMATION
var siloInfo winapi.SILOOBJECT_BASIC_INFORMATION
err := winapi.QueryInformationJobObject(
h,
winapi.JobObjectSiloBasicInformation,
Expand Down
15 changes: 15 additions & 0 deletions internal/winapi/jobobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ type JOBOBJECT_ASSOCIATE_COMPLETION_PORT struct {
CompletionPort windows.Handle
}

// typedef struct _SILOOBJECT_BASIC_INFORMATION {
// DWORD SiloId;
// DWORD SiloParentId;
// DWORD NumberOfProcesses;
// BOOLEAN IsInServerSilo;
// BYTE Reserved[3];
// } SILOOBJECT_BASIC_INFORMATION, *PSILOOBJECT_BASIC_INFORMATION;
type SILOOBJECT_BASIC_INFORMATION struct {
SiloID uint32
SiloParentID uint32
NumberOfProcesses uint32
IsInServerSilo bool
Reserved [3]uint8
}

// BOOL IsProcessInJob(
// HANDLE ProcessHandle,
// HANDLE JobHandle,
Expand Down

0 comments on commit 1550628

Please sign in to comment.