Windows2000 OSProcess test pilot needed

David T. Lewis lewis at mail.msen.com
Sun Mar 17 14:46:51 UTC 2002


Could some kind person with a Win2k box, Squeak, and OSProcess 3.0
please try running your system with the attached Win32OSProcessPlugin.dll
plugin and let me know if it works. In this case, "works" means:

1) Does not crash your VM.
2) "OSProcess thisOSProcess inspect" gives an inspector on your current
   OS process, including the pid and a reasonable looking environment
   dictionary.
3) Evaluating "self command: 'sol'" in the work pane of the inspector
   starts a Solitaire program. After exiting the Solitaire program,
   the "allMyChildren" instance variable of your current OS process
   shows the external OS process with runState #complete.

I am also attaching the source code patch for this, which contains a
new version of Win32OSProcessPlugin>>primitiveGetEnvironmentStrings
that minimizes use of the remappable oop buffer.

Thanks,
Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Win32OSProcessPlugin.dll
Type: application/octet-stream
Size: 11776 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020317/774532d2/Win32OSProcessPlugin.obj
-------------- next part --------------
'From Squeak3.1alpha of 27 September 2001 [latest update: #4347] on 17 March 2002 at 9:16:32 am'!

!Win32OSProcessPlugin methodsFor: 'primitives - OS process access' stamp: 'dtl 3/17/2002 09:15'!
primitiveGetEnvironmentStrings
	"Answer the environment block in the form of an Array of Strings. The
	caller is expected to parse the strings into a dictionary of keys and values."

	| pVarBlock p envArray count string |
	self export: true.
	self var: 'pVarBlock' declareC: 'TCHAR *pVarBlock'.
	self var: 'p' declareC: 'TCHAR *p'.
	pVarBlock _ self GetEnvironmentStrings.

	"Count the environment strings so the result array can be pre-allocated.
	This minimizes the number of objects which must be pushed onto the
	stack of remappable objects."
	p _ pVarBlock.
	count _ 0.
	[self cCode: '*p !!= 0' inSmalltalk: [pVarBlock ~= nil]] whileTrue:
		[count _ count + 1.
		[self cCode: '*p !!= 0' inSmalltalk: [p ~= nil]] whileTrue: [p _ p + 1].
		p _ p + 1].
	"Allocate an array for the strings."
	envArray _ interpreterProxy
		instantiateClass: interpreterProxy classArray
		indexableSize: count.
	"Populate the array."
	p _ pVarBlock.
	count _ 0.
	[self cCode: '*p !!= 0' inSmalltalk: [pVarBlock ~= nil]] whileTrue:
		[count _ count + 1.
		interpreterProxy pushRemappableOop: envArray.
		string _ self stringFromCString: p.	"May trigger garbage collection"
		envArray _ interpreterProxy popRemappableOop.
		interpreterProxy stObject: envArray at: count put: string.
		[self cCode: '*p !!= 0' inSmalltalk: [p ~= nil]] whileTrue: [p _ p + 1].
		p _ p + 1].
	self FreeEnvironmentStrings: pVarBlock.
	interpreterProxy pop: 1 thenPush: envArray! !



More information about the Squeak-dev mailing list